public ByteWritable evaluate(HiveDecimalWritable i) {
    if (i == null || !i.isSet() || !i.isByte()) {
      return null;
    } else {
      byteWritable.set(i.byteValue());
      return byteWritable;
    }
  }
Convert from string to a byte. This is called for CAST(... AS TINYINT)

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