The hive UDTF I coded, works fine as along as the number of output columns specified is two. But the moment, I change it to three and redeploy, it says the following error message.
FAILED: SemanticException [Error 10083]: The number of aliases supplied in the AS clause does not match the number of columns output by the UDTF expected 2 aliases but got 3
Is there any reason for it ?
Here's the code block I am using in initialize method.
List<String> fieldNames = new ArrayList<String>(3);
List<ObjectInspector> fieldOIs = new ArrayList<ObjectInspector>(3);
fieldNames.add("word");
fieldNames.add("cnt");
fieldNames.add("ext");
fieldOIs.add(PrimitiveObjectInspectorFactory.javaStringObjectInspector);
fieldOIs.add(PrimitiveObjectInspectorFactory.javaIntObjectInspector);
fieldOIs.add(PrimitiveObjectInspectorFactory.javaIntObjectInspector);
return ObjectInspectorFactory.getStandardStructObjectInspector(fieldNames, fieldOIs);
Here's the forward statement in process method
forward(new Object[] { "abcdef", Integer.valueOf(123), Integer.valueOf(123)});
Any help appreciated.