public LongWritable evaluate(HiveDecimalWritable i) {
    if (i == null || !i.isSet() || !i.isLong()) {
      return null;
    } else {
      longWritable.set(i.longValue());
      return longWritable;
    }
  }
Convert from string to a long. This is called for CAST(... AS BIGINT)

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