public ShortWritable evaluate(LongWritable i) {
    if (i == null) {
      return null;
    } else {
      shortWritable.set((short) i.get());
      return shortWritable;
    }
  }
Convert from long to a short. This is called for CAST(... AS SMALLINT)

@param i
         The long value to convert
@return ShortWritable
ql/src/java/org/apache/hadoop/hive/ql/udf/UDFToShort.java