public BooleanWritable evaluate(Text i) {
    if (i == null) {
      return null;
    }
    boolean b = PrimitiveObjectInspectorUtils.parseBoolean(i.getBytes(), 0, i.getLength());
    booleanWritable.set(b);
    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