public ByteWritable evaluate(BooleanWritable i) {
    if (i == null) {
      return null;
    } else {
      byteWritable.set(i.get() ? (byte) 1 : (byte) 0);
      return byteWritable;
    }
  }
Convert from boolean to a byte. This is called for CAST(... AS TINYINT)

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