public static class GenericUDAFSum.GenericUDAFSumHiveDecimal extends GenericUDAFEvaluator
GenericUDAFEvaluator.AbstractAggregationBuffer, GenericUDAFEvaluator.AggregationBuffer, GenericUDAFEvaluator.AggregationType, GenericUDAFEvaluator.Mode
Constructor and Description |
---|
GenericUDAFSum.GenericUDAFSumHiveDecimal() |
Modifier and Type | Method and Description |
---|---|
GenericUDAFEvaluator.AggregationBuffer |
getNewAggregationBuffer()
Get a new aggregation object.
|
GenericUDAFEvaluator |
getWindowingEvaluator(WindowFrameDef wFrmDef)
When evaluating an aggregates over a fixed Window, the naive way to compute
results is to compute the aggregate for each row.
|
ObjectInspector |
init(GenericUDAFEvaluator.Mode m,
ObjectInspector[] parameters)
Initialize the evaluator.
|
void |
iterate(GenericUDAFEvaluator.AggregationBuffer agg,
Object[] parameters)
Iterate through original data.
|
void |
merge(GenericUDAFEvaluator.AggregationBuffer agg,
Object partial)
Merge with partial aggregation result.
|
void |
reset(GenericUDAFEvaluator.AggregationBuffer agg)
Reset the aggregation.
|
Object |
terminate(GenericUDAFEvaluator.AggregationBuffer agg)
Get final aggregation result.
|
Object |
terminatePartial(GenericUDAFEvaluator.AggregationBuffer agg)
Get partial aggregation result.
|
aggregate, close, configure, evaluate, isEstimable
public GenericUDAFSum.GenericUDAFSumHiveDecimal()
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 GenericUDAFEvaluator.AggregationBuffer getNewAggregationBuffer() throws HiveException
GenericUDAFEvaluator
getNewAggregationBuffer
in class GenericUDAFEvaluator
HiveException
public void reset(GenericUDAFEvaluator.AggregationBuffer agg) throws HiveException
GenericUDAFEvaluator
reset
in class GenericUDAFEvaluator
HiveException
public void iterate(GenericUDAFEvaluator.AggregationBuffer agg, Object[] parameters) throws HiveException
GenericUDAFEvaluator
iterate
in class GenericUDAFEvaluator
parameters
- The objects of parameters.HiveException
public Object terminatePartial(GenericUDAFEvaluator.AggregationBuffer agg) throws HiveException
GenericUDAFEvaluator
terminatePartial
in class GenericUDAFEvaluator
HiveException
public void merge(GenericUDAFEvaluator.AggregationBuffer agg, Object partial) throws HiveException
GenericUDAFEvaluator
merge
in class GenericUDAFEvaluator
partial
- The partial aggregation result.HiveException
public Object terminate(GenericUDAFEvaluator.AggregationBuffer agg) throws HiveException
GenericUDAFEvaluator
terminate
in class GenericUDAFEvaluator
HiveException
public GenericUDAFEvaluator getWindowingEvaluator(WindowFrameDef wFrmDef)
GenericUDAFEvaluator
This method is called after this Evaluator is initialized. The returned Function must be initialized. It is passed the 'window' of aggregation for each row.
getWindowingEvaluator
in class GenericUDAFEvaluator
wFrmDef
- the Window definition in play for this evaluation.Copyright © 2017 The Apache Software Foundation. All rights reserved.