public ByteWritable evaluate(IntWritable i) {
    if (i == null) {
      return null;
    } else {
      byteWritable.set((byte) i.get());
      return byteWritable;
    }
  }
Convert from integer to a byte. This is called for CAST(... AS TINYINT)

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