@Override
  public ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumentException {
    if (arguments.length < 1) {
      throw new UDFArgumentLengthException(
          "The function CAST as TIMESTAMP WITH LOCAL TIME ZONE requires at least one argument, got "
              + arguments.length);
    }
    try {
      argumentOI = (PrimitiveObjectInspector) arguments[0];
      switch (argumentOI.getPrimitiveCategory()) {
      case CHAR:
      case VARCHAR:
      case STRING:
      case DATE:
      case TIMESTAMP:
      case TIMESTAMPLOCALTZ:
        break;
      default:
        throw new UDFArgumentException("CAST as TIMESTAMP WITH LOCAL TIME ZONE only allows" +
            "string/date/timestamp/timestamp with time zone types");
      }
    } catch (ClassCastException e) {
      throw new UDFArgumentException(
          "The function CAST as TIMESTAMP WITH LOCAL TIME ZONE takes only primitive types");
    }
    SettableTimestampLocalTZObjectInspector outputOI = (SettableTimestampLocalTZObjectInspector)
          PrimitiveObjectInspectorFactory.getPrimitiveWritableObjectInspector(typeInfo);
    converter = new TimestampLocalTZConverter(argumentOI, outputOI);
    return outputOI;
  }
Convert from string to TIMESTAMP WITH LOCAL TIME ZONE.
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFToTimestampLocalTZ.java