/** * Get the corresponding standard ObjectInspector for an ObjectInspector. * * The returned ObjectInspector can be used to inspect the standard object. */ public static ObjectInspector getStandardObjectInspector(ObjectInspector oi) { return getStandardObjectInspector(oi, ObjectInspectorCopyOption.DEFAULT); }
/** * Get the corresponding standard ObjectInspector array for an array of ObjectInspector. */ public static ObjectInspector[] getStandardObjectInspector(ObjectInspector[] ois, ObjectInspectorCopyOption objectInspectorOption) { if (ois == null) return null; ObjectInspector[] result = new ObjectInspector[ois.length]; for (int i = 0; i < ois.length; i++) { result[i] = getStandardObjectInspector(ois[i], objectInspectorOption); } return result; }
public static StructObjectInspector setupPartitionOutputOI(AbstractSerDe serDe, StructObjectInspector tblFnOI) throws SerDeException { return (StructObjectInspector) ObjectInspectorUtils.getStandardObjectInspector(tblFnOI, ObjectInspectorCopyOption.WRITABLE); }
public static StructObjectInspector setupPartitionOutputOI(AbstractSerDe serDe, StructObjectInspector tblFnOI) throws SerDeException { return (StructObjectInspector) ObjectInspectorUtils.getStandardObjectInspector(tblFnOI, ObjectInspectorCopyOption.WRITABLE); }
public MapJoinObjectSerDeContext(AbstractSerDe serde, boolean hasFilter) throws SerDeException { this.serde = serde; this.hasFilter = hasFilter; this.standardOI = ObjectInspectorUtils.getStandardObjectInspector(serde.getObjectInspector(), ObjectInspectorCopyOption.WRITABLE); }
@Override public ObjectInspector init(Mode m, ObjectInspector[] parameters) throws HiveException { assert (parameters.length == 1); super.init(m, parameters); result = new LongWritable(0); inputOI = (PrimitiveObjectInspector) parameters[0]; outputOI = (PrimitiveObjectInspector)ObjectInspectorUtils.getStandardObjectInspector(inputOI, ObjectInspectorCopyOption.JAVA); return PrimitiveObjectInspectorFactory.writableLongObjectInspector; }
@Override public ObjectInspector init(Mode m, ObjectInspector[] parameters) throws HiveException { assert (parameters.length == 1); super.init(m, parameters); inputOI = parameters[0]; // Copy to Java object because that saves object creation time. // Note that on average the number of copies is log(N) so that's not // very important. outputOI = ObjectInspectorUtils.getStandardObjectInspector(inputOI, ObjectInspectorCopyOption.JAVA); return outputOI; }
@Override public ObjectInspector init(Mode m, ObjectInspector[] parameters) throws HiveException { assert (parameters.length == 1); super.init(m, parameters); inputOI = parameters[0]; // Copy to Java object because that saves object creation time. // Note that on average the number of copies is log(N) so that's not // very important. outputOI = ObjectInspectorUtils.getStandardObjectInspector(inputOI, ObjectInspectorCopyOption.JAVA); return outputOI; }
public ExprNodeDynamicValueEvaluator(ExprNodeDynamicValueDesc expr, Configuration conf) { super(expr, conf); oi = ObjectInspectorUtils.getStandardObjectInspector(expr.getWritableObjectInspector(), ObjectInspectorCopyOption.WRITABLE); }
@Override public ObjectInspector init(Mode m, ObjectInspector[] parameters) throws HiveException { super.init(m, parameters); if (mode == Mode.PARTIAL2 || mode == Mode.FINAL) { partialCountAggOI = (LongObjectInspector)parameters[0]; } else { inputOI = parameters; outputOI = ObjectInspectorUtils.getStandardObjectInspector(inputOI, ObjectInspectorCopyOption.JAVA); } result = new LongWritable(0); return PrimitiveObjectInspectorFactory.writableLongObjectInspector; }
@Override public ObjectInspector init(Mode m, ObjectInspector[] parameters) throws HiveException { assert (parameters.length == 1); super.init(m, parameters); result = new LongWritable(0); inputOI = (PrimitiveObjectInspector) parameters[0]; outputOI = (PrimitiveObjectInspector)ObjectInspectorUtils.getStandardObjectInspector(inputOI, ObjectInspectorCopyOption.JAVA); return PrimitiveObjectInspectorFactory.writableLongObjectInspector; }
@Override public ObjectInspector init(Mode m, ObjectInspector[] parameters) throws HiveException { assert (parameters.length == 1); super.init(m, parameters); inputOI = parameters[0]; // Copy to Java object because that saves object creation time. // Note that on average the number of copies is log(N) so that's not // very important. outputOI = ObjectInspectorUtils.getStandardObjectInspector(inputOI, ObjectInspectorCopyOption.JAVA); return outputOI; }
@Override public ObjectInspector init(Mode m, ObjectInspector[] parameters) throws HiveException { assert (parameters.length == 1); super.init(m, parameters); result = new DoubleWritable(0); inputOI = (PrimitiveObjectInspector) parameters[0]; outputOI = (PrimitiveObjectInspector)ObjectInspectorUtils.getStandardObjectInspector(inputOI, ObjectInspectorCopyOption.JAVA); return PrimitiveObjectInspectorFactory.writableDoubleObjectInspector; }
@Override public ObjectInspector init(Mode m, ObjectInspector[] parameters) throws HiveException { super.init(m, parameters); if (m != Mode.COMPLETE) { throw new HiveException("Only COMPLETE mode supported for Rank function"); } inputOI = parameters[0]; outputOI = ObjectInspectorUtils.getStandardObjectInspector(inputOI, ObjectInspectorCopyOption.WRITABLE); return outputOI; }
@Override public ObjectInspector init(Mode m, ObjectInspector[] parameters) throws HiveException { super.init(m, parameters); if (m != Mode.COMPLETE) { throw new HiveException("Only COMPLETE mode supported for Rank function"); } inputOI = parameters[0]; outputOI = ObjectInspectorUtils.getStandardObjectInspector(inputOI, ObjectInspectorCopyOption.WRITABLE); return outputOI; }
@Override public ObjectInspector init(Mode m, ObjectInspector[] parameters) throws HiveException { super.init(m, parameters); if (m != Mode.COMPLETE) { throw new HiveException("Only COMPLETE mode supported for Rank function"); } inputOI = parameters[0]; outputOI = ObjectInspectorUtils.getStandardObjectInspector(inputOI, ObjectInspectorCopyOption.WRITABLE); return outputOI; }
@Override public ObjectInspector init(Mode m, ObjectInspector[] parameters) throws HiveException { assert (parameters.length == 1); super.init(m, parameters); result = new DoubleWritable(0); inputOI = (PrimitiveObjectInspector) parameters[0]; outputOI = (PrimitiveObjectInspector)ObjectInspectorUtils.getStandardObjectInspector(inputOI, ObjectInspectorCopyOption.JAVA); return PrimitiveObjectInspectorFactory.writableDoubleObjectInspector; }
@Override public ObjectInspector init(Mode m, ObjectInspector[] parameters) throws HiveException { super.init(m, parameters); if (m != Mode.COMPLETE) { throw new HiveException("Only COMPLETE mode supported for Rank function"); } inputOI = parameters; outputOI = new ObjectInspector[inputOI.length]; for (int i = 0; i < inputOI.length; i++) { outputOI[i] = ObjectInspectorUtils.getStandardObjectInspector(inputOI[i], ObjectInspectorCopyOption.JAVA); } return ObjectInspectorFactory.getStandardListObjectInspector( PrimitiveObjectInspectorFactory.writableIntObjectInspector); }
@Override public ObjectInspector init(Mode m, ObjectInspector[] parameters) throws HiveException { super.init(m, parameters); if (m != Mode.COMPLETE) { throw new HiveException("Only COMPLETE mode supported for " + fnName + " function"); } inputOI = parameters; if (parameters.length == 3) { defaultValueConverter = ObjectInspectorConverters .getConverter(parameters[2], parameters[0]); } return ObjectInspectorFactory.getStandardListObjectInspector(ObjectInspectorUtils .getStandardObjectInspector(parameters[0])); }
private PTFRowContainer<List<Object>> rowContainer(int blockSize) throws SerDeException, HiveException { PTFRowContainer<List<Object>> rc = new PTFRowContainer<List<Object>>(blockSize, cfg, null); rc.setSerDe(serDe, ObjectInspectorUtils.getStandardObjectInspector(serDe.getObjectInspector())); rc.setTableDesc( PTFRowContainer.createTableDesc((StructObjectInspector) serDe.getObjectInspector())); return rc; }