throw new UDFArgumentException(
"The function VARCHAR takes only primitive types");
}
// Check if this UDF has been provided with type params for the output varchar type
SettableHiveVarcharObjectInspector outputOI;
if (typeParams != null) {
outputOI = (SettableHiveVarcharObjectInspector)
PrimitiveObjectInspectorFactory.getPrimitiveWritableObjectInspector(
PrimitiveObjectInspectorUtils.getTypeEntryFromTypeSpecs(
PrimitiveCategory.VARCHAR, typeParams));