@Override
  public Object evaluate(DeferredObject[] arguments) throws HiveException {
    Object input = ((PrimitiveObjectInspector) argumentOIs[0]).getPrimitiveJavaObject(arguments[0].get());
    if ("true".equalsIgnoreCase(input.toString())) {
      return Boolean.TRUE;
    } else if ("false".equalsIgnoreCase(input.toString())) {
      return false;
    } else {
      return null;
    }
  }
A test GenericUDF to return native Java's boolean type
itests/util/src/main/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFTestGetJavaBoolean.java