public abstract static class GenericUDAFPercentileCont.PercentileContEvaluator<T,U> extends GenericUDAFEvaluator
| Modifier and Type | Class and Description |
|---|---|
class |
GenericUDAFPercentileCont.PercentileContEvaluator.PercentileAgg
A state class to store intermediate aggregation results.
|
GenericUDAFEvaluator.AbstractAggregationBuffer, GenericUDAFEvaluator.AggregationBuffer, GenericUDAFEvaluator.AggregationType, GenericUDAFEvaluator.Mode| Modifier and Type | Field and Description |
|---|---|
protected StructField |
countsField |
protected PrimitiveObjectInspector |
inputOI |
protected boolean |
isAscending |
protected StructField |
isAscendingField |
protected Object[] |
partialResult |
protected StructField |
percentilesField |
protected List<DoubleWritable> |
results |
protected StructObjectInspector |
soi |
partitionEvaluator| Modifier | Constructor and Description |
|---|---|
protected |
PercentileContEvaluator(Comparator<Map.Entry<U,org.apache.hadoop.io.LongWritable>> comparator,
org.apache.hadoop.hive.ql.udf.generic.GenericUDAFPercentileCont.Converter converter) |
aggregate, close, configure, createPartitionEvaluator, estimate, evaluate, getExprString, getPartitionWindowingEvaluator, getWindowingEvaluator, isEstimableprotected PrimitiveObjectInspector inputOI
protected transient Object[] partialResult
protected List<DoubleWritable> results
protected transient StructObjectInspector soi
protected transient StructField countsField
protected transient StructField percentilesField
protected transient StructField isAscendingField
protected transient boolean isAscending
protected PercentileContEvaluator(Comparator<Map.Entry<U,org.apache.hadoop.io.LongWritable>> comparator, org.apache.hadoop.hive.ql.udf.generic.GenericUDAFPercentileCont.Converter converter)
public ObjectInspector init(GenericUDAFEvaluator.Mode m, ObjectInspector[] parameters) throws HiveException
GenericUDAFEvaluatorinit in class GenericUDAFEvaluatorm - 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).HiveExceptionprotected abstract GenericUDAFPercentileCont.PercentileCalculator<U> getCalculator()
protected abstract ArrayList<ObjectInspector> getPartialInspectors()
protected abstract T getInput(Object object, PrimitiveObjectInspector inputOI)
protected void initInspectors(PrimitiveObjectInspector orderByColumnOI)
protected void initInspectors(PrimitiveObjectInspector orderByColumnOI, WritableConstantIntObjectInspector orderDirectionOI)
protected void initPartialInspectors(StructObjectInspector objectInspector)
public GenericUDAFEvaluator.AggregationBuffer getNewAggregationBuffer() throws HiveException
GenericUDAFEvaluatorgetNewAggregationBuffer in class GenericUDAFEvaluatorHiveExceptionpublic void reset(GenericUDAFEvaluator.AggregationBuffer agg) throws HiveException
GenericUDAFEvaluatorreset in class GenericUDAFEvaluatorHiveExceptionpublic void iterate(GenericUDAFEvaluator.AggregationBuffer agg, Object[] parameters) throws HiveException
GenericUDAFEvaluatoriterate in class GenericUDAFEvaluatorparameters - The objects of parameters.HiveExceptionprotected void increment(GenericUDAFPercentileCont.PercentileContEvaluator.PercentileAgg s, U input, long i)
public void merge(GenericUDAFEvaluator.AggregationBuffer agg, Object partial) throws HiveException
GenericUDAFEvaluatormerge in class GenericUDAFEvaluatorpartial - The partial aggregation result.HiveExceptionpublic Object terminate(GenericUDAFEvaluator.AggregationBuffer agg) throws HiveException
GenericUDAFEvaluatorterminate in class GenericUDAFEvaluatorHiveExceptionpublic Object terminatePartial(GenericUDAFEvaluator.AggregationBuffer agg) throws HiveException
GenericUDAFEvaluatorterminatePartial in class GenericUDAFEvaluatorHiveExceptionpublic static void validatePercentile(Double percentile)
protected List<DoubleWritable> calculatePercentile(List<DoubleWritable> percentiles, List<Map.Entry<U,org.apache.hadoop.io.LongWritable>> entriesList, long total, List<DoubleWritable> results)
Copyright © 2022 The Apache Software Foundation. All rights reserved.