@Override public ObjectInspector initialize(ObjectInspector rowInspector) throws HiveException { deferredChildren = new GenericUDF.DeferredObject[children.length]; List<GenericUDF.DeferredObject> childrenNeedingPrepare = new ArrayList<GenericUDF.DeferredObject>(children.length); for (int i = 0; i < deferredChildren.length; i++) { DeferredExprObject deferredExprObject = new DeferredExprObject(children[i], isEager); deferredChildren[i] = deferredExprObject; if (deferredExprObject.needsPrepare()) { childrenNeedingPrepare.add(deferredExprObject); } } this.childrenNeedingPrepare = childrenNeedingPrepare.toArray(new GenericUDF.DeferredObject[childrenNeedingPrepare.size()]); // Initialize all children first ObjectInspector[] childrenOIs = new ObjectInspector[children.length]; for (int i = 0; i < children.length; i++) { childrenOIs[i] = children[i].initialize(rowInspector); } MapredContext context = MapredContext.get(); if (context != null) { context.setup(genericUDF); } outputOI = genericUDF.initializeAndFoldConstants(childrenOIs); isConstant = ObjectInspectorUtils.isConstantObjectInspector(outputOI) && isConsistentWithinQuery(); return outputOI; }
@Override public ObjectInspector initialize(ObjectInspector rowInspector) throws HiveException { deferredChildren = new GenericUDF.DeferredObject[children.length]; List<GenericUDF.DeferredObject> childrenNeedingPrepare = new ArrayList<GenericUDF.DeferredObject>(children.length); for (int i = 0; i < deferredChildren.length; i++) { DeferredExprObject deferredExprObject = new DeferredExprObject(children[i], isEager); deferredChildren[i] = deferredExprObject; if (deferredExprObject.needsPrepare()) { childrenNeedingPrepare.add(deferredExprObject); } } this.childrenNeedingPrepare = childrenNeedingPrepare.toArray(new GenericUDF.DeferredObject[childrenNeedingPrepare.size()]); // Initialize all children first ObjectInspector[] childrenOIs = new ObjectInspector[children.length]; for (int i = 0; i < children.length; i++) { childrenOIs[i] = children[i].initialize(rowInspector); } MapredContext context = MapredContext.get(); if (context != null) { context.setup(genericUDF); } outputOI = genericUDF.initializeAndFoldConstants(childrenOIs); isConstant = ObjectInspectorUtils.isConstantObjectInspector(outputOI) && isDeterministic(); return outputOI; }
@Override protected void initializeOp(Configuration hconf) throws HiveException { super.initializeOp(hconf); genericUDTF = conf.getGenericUDTF(); collector = new UDTFCollector(this); genericUDTF.setCollector(collector); udtfInputOI = (StructObjectInspector) inputObjInspectors[0]; objToSendToUDTF = new Object[udtfInputOI.getAllStructFieldRefs().size()]; MapredContext context = MapredContext.get(); if (context != null) { context.setup(genericUDTF); } StructObjectInspector udtfOutputOI = genericUDTF.initialize(udtfInputOI); if (conf.isOuterLV()) { outerObj = Arrays.asList(new Object[udtfOutputOI.getAllStructFieldRefs().size()]); } // Since we're passing the object output by the UDTF directly to the next // operator, we can use the same OI. outputObjInspector = udtfOutputOI; // Set up periodic progress reporting in case the UDTF doesn't output rows // for a while if (HiveConf.getBoolVar(hconf, HiveConf.ConfVars.HIVEUDTFAUTOPROGRESS)) { autoProgressor = new AutoProgressor(this.getClass().getName(), reporter, Utilities.getDefaultNotificationInterval(hconf), HiveConf.getTimeVar( hconf, HiveConf.ConfVars.HIVES_AUTO_PROGRESS_TIMEOUT, TimeUnit.MILLISECONDS)); autoProgressor.go(); } }
@Override protected void initializeOp(Configuration hconf) throws HiveException { super.initializeOp(hconf); genericUDTF = conf.getGenericUDTF(); collector = new UDTFCollector(this); genericUDTF.setCollector(collector); udtfInputOI = (StructObjectInspector) inputObjInspectors[0]; objToSendToUDTF = new Object[udtfInputOI.getAllStructFieldRefs().size()]; MapredContext context = MapredContext.get(); if (context != null) { context.setup(genericUDTF); } StructObjectInspector udtfOutputOI = genericUDTF.initialize(udtfInputOI); if (conf.isOuterLV()) { outerObj = Arrays.asList(new Object[udtfOutputOI.getAllStructFieldRefs().size()]); } // Since we're passing the object output by the UDTF directly to the next // operator, we can use the same OI. outputObjInspector = udtfOutputOI; // Set up periodic progress reporting in case the UDTF doesn't output rows // for a while if (HiveConf.getBoolVar(hconf, HiveConf.ConfVars.HIVEUDTFAUTOPROGRESS)) { autoProgressor = new AutoProgressor(this.getClass().getName(), reporter, Utilities.getDefaultNotificationInterval(hconf), HiveConf.getTimeVar( hconf, HiveConf.ConfVars.HIVES_AUTO_PROGRESS_TIMEOUT, TimeUnit.MILLISECONDS)); autoProgressor.go(); } }
if (context != null) { for (GenericUDAFEvaluator genericUDAFEvaluator : aggregationEvaluators) { context.setup(genericUDAFEvaluator);
if (context != null) { for (GenericUDAFEvaluator genericUDAFEvaluator : aggregationEvaluators) { context.setup(genericUDAFEvaluator);
public void init() throws HiveException, UDFArgumentException { genericUDF = expr.getGenericUDF(); deferredChildren = new GenericUDF.DeferredObject[expr.getChildren().size()]; childrenOIs = new ObjectInspector[expr.getChildren().size()]; writers = VectorExpressionWriterFactory.getExpressionWriters(expr.getChildren()); for (int i = 0; i < childrenOIs.length; i++) { childrenOIs[i] = writers[i].getObjectInspector(); } MapredContext context = MapredContext.get(); if (context != null) { context.setup(genericUDF); } outputTypeInfo = expr.getTypeInfo(); outputVectorAssignRow = new VectorAssignRow(); outputVectorAssignRow.init(outputTypeInfo, outputColumnNum); genericUDF.initialize(childrenOIs); // Initialize constant arguments for (int i = 0; i < argDescs.length; i++) { if (argDescs[i].isConstant()) { argDescs[i].prepareConstant(); } } }
public void init() throws HiveException, UDFArgumentException { genericUDF = expr.getGenericUDF(); deferredChildren = new GenericUDF.DeferredObject[expr.getChildren().size()]; childrenOIs = new ObjectInspector[expr.getChildren().size()]; writers = VectorExpressionWriterFactory.getExpressionWriters(expr.getChildren()); for (int i = 0; i < childrenOIs.length; i++) { childrenOIs[i] = writers[i].getObjectInspector(); } MapredContext context = MapredContext.get(); if (context != null) { context.setup(genericUDF); } outputOI = VectorExpressionWriterFactory.genVectorExpressionWritable(expr) .getObjectInspector(); genericUDF.initialize(childrenOIs); // Initialize constant arguments for (int i = 0; i < argDescs.length; i++) { if (argDescs[i].isConstant()) { argDescs[i].prepareConstant(); } } }
@Override public ObjectInspector initialize(ObjectInspector rowInspector) throws HiveException { deferredChildren = new GenericUDF.DeferredObject[children.length]; List<GenericUDF.DeferredObject> childrenNeedingPrepare = new ArrayList<GenericUDF.DeferredObject>(children.length); for (int i = 0; i < deferredChildren.length; i++) { DeferredExprObject deferredExprObject = new DeferredExprObject(children[i], isEager); deferredChildren[i] = deferredExprObject; if (deferredExprObject.needsPrepare()) { childrenNeedingPrepare.add(deferredExprObject); } } this.childrenNeedingPrepare = childrenNeedingPrepare.toArray(new GenericUDF.DeferredObject[childrenNeedingPrepare.size()]); // Initialize all children first ObjectInspector[] childrenOIs = new ObjectInspector[children.length]; for (int i = 0; i < children.length; i++) { childrenOIs[i] = children[i].initialize(rowInspector); } MapredContext context = MapredContext.get(); if (context != null) { context.setup(genericUDF); } outputOI = genericUDF.initializeAndFoldConstants(childrenOIs); isConstant = ObjectInspectorUtils.isConstantObjectInspector(outputOI) && isDeterministic(); return outputOI; }
@Override protected Collection<Future<?>> initializeOp(Configuration hconf) throws HiveException { Collection<Future<?>> result = super.initializeOp(hconf); genericUDTF = conf.getGenericUDTF(); collector = new UDTFCollector(this); genericUDTF.setCollector(collector); udtfInputOI = (StructObjectInspector) inputObjInspectors[0]; objToSendToUDTF = new Object[udtfInputOI.getAllStructFieldRefs().size()]; MapredContext context = MapredContext.get(); if (context != null) { context.setup(genericUDTF); } StructObjectInspector udtfOutputOI = genericUDTF.initialize(udtfInputOI); if (conf.isOuterLV()) { outerObj = Arrays.asList(new Object[udtfOutputOI.getAllStructFieldRefs().size()]); } // Since we're passing the object output by the UDTF directly to the next // operator, we can use the same OI. outputObjInspector = udtfOutputOI; // Set up periodic progress reporting in case the UDTF doesn't output rows // for a while if (HiveConf.getBoolVar(hconf, HiveConf.ConfVars.HIVEUDTFAUTOPROGRESS)) { autoProgressor = new AutoProgressor(this.getClass().getName(), reporter, Utilities.getDefaultNotificationInterval(hconf), HiveConf.getTimeVar( hconf, HiveConf.ConfVars.HIVES_AUTO_PROGRESS_TIMEOUT, TimeUnit.MILLISECONDS)); autoProgressor.go(); } return result; }
if (context != null) { for (GenericUDAFEvaluator genericUDAFEvaluator : aggregationEvaluators) { context.setup(genericUDAFEvaluator);