public BooleanWritable evaluate(TimestampWritableV2 i) {
    if (i == null) {
      return null;
    } else {
      TimestampTZ timestamp = UDFUtils.getTimestampTZFromTimestamp(i.getTimestamp());
      booleanWritable.set((timestamp.getEpochSecond() != 0) || (timestamp.getNanos() != 0));
      return booleanWritable;
    }
  }
Convert from a string to boolean. This is called for CAST(... AS BOOLEAN)

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