public abstract class GenericUDAFEvaluator
extends java.lang.Object
implements java.io.Closeable
| Modifier and Type | Class and Description |
|---|---|
static class |
GenericUDAFEvaluator.AbstractAggregationBuffer |
static interface |
GenericUDAFEvaluator.AggregationBuffer
Deprecated.
use
GenericUDAFEvaluator.AbstractAggregationBuffer instead |
static interface |
GenericUDAFEvaluator.AggregationType |
static class |
GenericUDAFEvaluator.Mode
Mode.
|
| Constructor and Description |
|---|
GenericUDAFEvaluator()
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
aggregate(GenericUDAFEvaluator.AggregationBuffer agg,
java.lang.Object[] parameters)
This function will be called by GroupByOperator when it sees a new input
row.
|
void |
close()
Close GenericUDFEvaluator.
|
void |
configure(MapredContext mapredContext)
Additionally setup GenericUDAFEvaluator with MapredContext before initializing.
|
java.lang.Object |
evaluate(GenericUDAFEvaluator.AggregationBuffer agg)
This function will be called by GroupByOperator when it sees a new input
row.
|
abstract GenericUDAFEvaluator.AggregationBuffer |
getNewAggregationBuffer()
Get a new aggregation object.
|
ObjectInspector |
init(GenericUDAFEvaluator.Mode m,
ObjectInspector[] parameters)
Initialize the evaluator.
|
static boolean |
isEstimable(GenericUDAFEvaluator.AggregationBuffer buffer) |
abstract void |
iterate(GenericUDAFEvaluator.AggregationBuffer agg,
java.lang.Object[] parameters)
Iterate through original data.
|
abstract void |
merge(GenericUDAFEvaluator.AggregationBuffer agg,
java.lang.Object partial)
Merge with partial aggregation result.
|
abstract void |
reset(GenericUDAFEvaluator.AggregationBuffer agg)
Reset the aggregation.
|
abstract java.lang.Object |
terminate(GenericUDAFEvaluator.AggregationBuffer agg)
Get final aggregation result.
|
abstract java.lang.Object |
terminatePartial(GenericUDAFEvaluator.AggregationBuffer agg)
Get partial aggregation result.
|
public static boolean isEstimable(GenericUDAFEvaluator.AggregationBuffer buffer)
public void configure(MapredContext mapredContext)
context - contextpublic ObjectInspector init(GenericUDAFEvaluator.Mode m, ObjectInspector[] parameters) throws HiveException
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).HiveExceptionpublic abstract GenericUDAFEvaluator.AggregationBuffer getNewAggregationBuffer() throws HiveException
HiveExceptionpublic abstract void reset(GenericUDAFEvaluator.AggregationBuffer agg) throws HiveException
HiveExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionpublic void aggregate(GenericUDAFEvaluator.AggregationBuffer agg, java.lang.Object[] parameters) throws HiveException
agg - The object to store the aggregation result.parameters - The row, can be inspected by the OIs passed in init().HiveExceptionpublic java.lang.Object evaluate(GenericUDAFEvaluator.AggregationBuffer agg) throws HiveException
agg - The object to store the aggregation result.HiveExceptionpublic abstract void iterate(GenericUDAFEvaluator.AggregationBuffer agg, java.lang.Object[] parameters) throws HiveException
parameters - The objects of parameters.HiveExceptionpublic abstract java.lang.Object terminatePartial(GenericUDAFEvaluator.AggregationBuffer agg) throws HiveException
HiveExceptionpublic abstract void merge(GenericUDAFEvaluator.AggregationBuffer agg, java.lang.Object partial) throws HiveException
partial - The partial aggregation result.HiveExceptionpublic abstract java.lang.Object terminate(GenericUDAFEvaluator.AggregationBuffer agg) throws HiveException
HiveExceptionCopyright © 2012 The Apache Software Foundation