colNames.add(inputCols.get(i).getInternalName());
colOIs[i] = TypeInfoUtils
.getStandardWritableObjectInspectorFromTypeInfo(inputCols.get(i)
.getType());
}
StructObjectInspector outputOI = genericUDTF.initialize(colOIs);
// Make sure that the number of column aliases in the AS clause matches
// the number of columns output by the UDTF
int numUdtfCols = outputOI.getAllStructFieldRefs().size();
int numSuppliedAliases = colAliases.size();
if (numUdtfCols != numSuppliedAliases) {
throw new SemanticException(ErrorMsg.UDTF_ALIAS_MISMATCH
.getMsg("expected " + numUdtfCols + " aliases " + "but got "
+ numSuppliedAliases));
}
// Generate the output column info's / row resolver using internal names.
ArrayList<ColumnInfo> udtfCols = new ArrayList<ColumnInfo>();
Iterator<String> colAliasesIter = colAliases.iterator();
for (StructField sf : outputOI.getAllStructFieldRefs()) {
String colAlias = colAliasesIter.next();
assert (colAlias != null);
// Since the UDTF operator feeds into a LVJ operator that will rename