@Override public ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumentException { int numFields = arguments.length; ret = new Object[numFields]; ArrayList<String> fname = new ArrayList<String>(numFields); for (int f = 1; f <= numFields; f++) { fname.add("col" + f); } boolean constantStruct = true; for (int i = 0; i < arguments.length; i++) { ObjectInspector oi = arguments[i]; constantStruct &= (oi.getCategory() == Category.PRIMITIVE) && (oi instanceof ConstantObjectInspector); if (constantStruct) { // nested complex types trigger Kryo issue #216 in plan deserialization ret[i] = ((ConstantObjectInspector) oi).getWritableConstantValue(); } } if (constantStruct) { return ObjectInspectorFactory.getStandardConstantStructObjectInspector(fname, Arrays.asList(arguments), Arrays.asList(ret)); } else { return ObjectInspectorFactory.getStandardStructObjectInspector(fname, Arrays.asList(arguments)); } }
@Override public ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumentException { int numFields = arguments.length; ret = new Object[numFields]; ArrayList<String> fname = new ArrayList<String>(numFields); for (int f = 1; f <= numFields; f++) { fname.add("col" + f); } boolean constantStruct = true; for (int i = 0; i < arguments.length; i++) { ObjectInspector oi = arguments[i]; constantStruct &= (oi.getCategory() == Category.PRIMITIVE) && (oi instanceof ConstantObjectInspector); if (constantStruct) { // nested complex types trigger Kryo issue #216 in plan deserialization ret[i] = ((ConstantObjectInspector) oi).getWritableConstantValue(); } } if (constantStruct) { return ObjectInspectorFactory.getStandardConstantStructObjectInspector(fname, Arrays.asList(arguments), Arrays.asList(ret)); } else { return ObjectInspectorFactory.getStandardStructObjectInspector(fname, Arrays.asList(arguments)); } }
ObjectInspectorFactory.getStandardConstantStructObjectInspector( fieldNames, fieldObjectInspectors,
writableValue = java.util.Arrays.asList((Object[])writableValue); return ObjectInspectorFactory.getStandardConstantStructObjectInspector( fieldNames, fieldObjectInspectors,
writableValue = java.util.Arrays.asList((Object[])writableValue); return ObjectInspectorFactory.getStandardConstantStructObjectInspector( fieldNames, fieldObjectInspectors,