use of org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaTimestampObjectInspector in project hive by apache.
the class GenericUDFFromUtcTimestamp method initialize.
@Override
public ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumentException {
if (arguments.length != 2) {
throw new UDFArgumentLengthException("The function " + getName() + " requires two " + "argument, got " + arguments.length);
}
try {
argumentOIs = new PrimitiveObjectInspector[2];
argumentOIs[0] = (PrimitiveObjectInspector) arguments[0];
argumentOIs[1] = (PrimitiveObjectInspector) arguments[1];
} catch (ClassCastException e) {
throw new UDFArgumentException("The function " + getName() + " takes only primitive types");
}
timestampConverter = new TimestampConverter(argumentOIs[0], PrimitiveObjectInspectorFactory.writableTimestampObjectInspector);
textConverter = new TextConverter(argumentOIs[1]);
return PrimitiveObjectInspectorFactory.javaTimestampObjectInspector;
}
Aggregations