public IntWritable evaluate(BooleanWritable i) {
    if (i == null) {
      return null;
    } else {
      intWritable.set(i.get() ? 1 : 0);
      return intWritable;
    }
  }
Convert from boolean to an integer. This is called for CAST(... AS INT)

@param i
         The boolean value to convert
@return IntWritable
ql/src/java/org/apache/hadoop/hive/ql/udf/UDFToInteger.java