public abstract static class GenericUDAFAverage.AbstractGenericUDAFAverageEvaluator<TYPE> extends GenericUDAFEvaluator
GenericUDAFEvaluator.AbstractAggregationBuffer, GenericUDAFEvaluator.AggregationBuffer, GenericUDAFEvaluator.AggregationType, GenericUDAFEvaluator.Mode
Modifier and Type | Field and Description |
---|---|
protected PrimitiveObjectInspector |
inputOI |
protected Object[] |
partialResult |
protected ObjectInspector |
sumFieldOI |
Constructor and Description |
---|
GenericUDAFAverage.AbstractGenericUDAFAverageEvaluator() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
doIterate(org.apache.hadoop.hive.ql.udf.generic.GenericUDAFAverage.AverageAggregationBuffer<TYPE> aggregation,
PrimitiveObjectInspector inputOI,
Object parameter) |
protected abstract void |
doMerge(org.apache.hadoop.hive.ql.udf.generic.GenericUDAFAverage.AverageAggregationBuffer<TYPE> aggregation,
Long partialCount,
ObjectInspector sumFieldOI,
Object partialSum) |
protected abstract void |
doReset(org.apache.hadoop.hive.ql.udf.generic.GenericUDAFAverage.AverageAggregationBuffer<TYPE> aggregation) |
protected abstract Object |
doTerminate(org.apache.hadoop.hive.ql.udf.generic.GenericUDAFAverage.AverageAggregationBuffer<TYPE> aggregation) |
protected abstract void |
doTerminatePartial(org.apache.hadoop.hive.ql.udf.generic.GenericUDAFAverage.AverageAggregationBuffer<TYPE> aggregation) |
protected abstract ObjectInspector |
getSumFieldJavaObjectInspector() |
protected abstract ObjectInspector |
getSumFieldWritableObjectInspector() |
ObjectInspector |
init(GenericUDAFEvaluator.Mode m,
ObjectInspector[] parameters)
Initialize the evaluator.
|
void |
iterate(GenericUDAFEvaluator.AggregationBuffer aggregation,
Object[] parameters)
Iterate through original data.
|
void |
merge(GenericUDAFEvaluator.AggregationBuffer aggregation,
Object partial)
Merge with partial aggregation result.
|
void |
reset(GenericUDAFEvaluator.AggregationBuffer aggregation)
Reset the aggregation.
|
Object |
terminate(GenericUDAFEvaluator.AggregationBuffer aggregation)
Get final aggregation result.
|
Object |
terminatePartial(GenericUDAFEvaluator.AggregationBuffer aggregation)
Get partial aggregation result.
|
aggregate, close, configure, evaluate, getNewAggregationBuffer, getWindowingEvaluator, isEstimable
protected transient PrimitiveObjectInspector inputOI
protected ObjectInspector sumFieldOI
protected transient Object[] partialResult
public GenericUDAFAverage.AbstractGenericUDAFAverageEvaluator()
protected abstract ObjectInspector getSumFieldJavaObjectInspector()
protected abstract ObjectInspector getSumFieldWritableObjectInspector()
protected abstract void doIterate(org.apache.hadoop.hive.ql.udf.generic.GenericUDAFAverage.AverageAggregationBuffer<TYPE> aggregation, PrimitiveObjectInspector inputOI, Object parameter)
protected abstract void doMerge(org.apache.hadoop.hive.ql.udf.generic.GenericUDAFAverage.AverageAggregationBuffer<TYPE> aggregation, Long partialCount, ObjectInspector sumFieldOI, Object partialSum)
protected abstract void doTerminatePartial(org.apache.hadoop.hive.ql.udf.generic.GenericUDAFAverage.AverageAggregationBuffer<TYPE> aggregation)
protected abstract Object doTerminate(org.apache.hadoop.hive.ql.udf.generic.GenericUDAFAverage.AverageAggregationBuffer<TYPE> aggregation)
protected abstract void doReset(org.apache.hadoop.hive.ql.udf.generic.GenericUDAFAverage.AverageAggregationBuffer<TYPE> aggregation) throws HiveException
HiveException
public ObjectInspector init(GenericUDAFEvaluator.Mode m, ObjectInspector[] parameters) throws HiveException
GenericUDAFEvaluator
init
in class GenericUDAFEvaluator
m
- The mode of aggregation.parameters
- The ObjectInspector for the parameters: In PARTIAL1 and COMPLETE
mode, the parameters are original data; In PARTIAL2 and FINAL
mode, the parameters are just partial aggregations (in that case,
the array will always have a single element).HiveException
public void reset(GenericUDAFEvaluator.AggregationBuffer aggregation) throws HiveException
GenericUDAFEvaluator
reset
in class GenericUDAFEvaluator
HiveException
public void iterate(GenericUDAFEvaluator.AggregationBuffer aggregation, Object[] parameters) throws HiveException
GenericUDAFEvaluator
iterate
in class GenericUDAFEvaluator
parameters
- The objects of parameters.HiveException
public Object terminatePartial(GenericUDAFEvaluator.AggregationBuffer aggregation) throws HiveException
GenericUDAFEvaluator
terminatePartial
in class GenericUDAFEvaluator
HiveException
public void merge(GenericUDAFEvaluator.AggregationBuffer aggregation, Object partial) throws HiveException
GenericUDAFEvaluator
merge
in class GenericUDAFEvaluator
partial
- The partial aggregation result.HiveException
public Object terminate(GenericUDAFEvaluator.AggregationBuffer aggregation) throws HiveException
GenericUDAFEvaluator
terminate
in class GenericUDAFEvaluator
HiveException
Copyright © 2017 The Apache Software Foundation. All rights reserved.