org.apache.hadoop.hive.ql.udf.generic
Class GenericUDAFPercentileApprox.GenericUDAFPercentileApproxEvaluator

java.lang.Object
  extended by org.apache.hadoop.hive.ql.udf.generic.GenericUDAFEvaluator
      extended by org.apache.hadoop.hive.ql.udf.generic.GenericUDAFPercentileApprox.GenericUDAFPercentileApproxEvaluator
Direct Known Subclasses:
GenericUDAFPercentileApprox.GenericUDAFMultiplePercentileApproxEvaluator, GenericUDAFPercentileApprox.GenericUDAFSinglePercentileApproxEvaluator
Enclosing class:
GenericUDAFPercentileApprox

public abstract static class GenericUDAFPercentileApprox.GenericUDAFPercentileApproxEvaluator
extends GenericUDAFEvaluator

Construct a histogram using the algorithm described by Ben-Haim and Tom-Tov, and then use it to compute an approximate percentile value.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.hive.ql.udf.generic.GenericUDAFEvaluator
GenericUDAFEvaluator.AggregationBuffer, GenericUDAFEvaluator.Mode
 
Field Summary
protected  PrimitiveObjectInspector inputOI
           
protected  StandardListObjectInspector loi
           
protected  PrimitiveObjectInspector nbinsOI
           
protected  ObjectInspector quantilesOI
           
 
Constructor Summary
GenericUDAFPercentileApprox.GenericUDAFPercentileApproxEvaluator()
           
 
Method Summary
 GenericUDAFEvaluator.AggregationBuffer getNewAggregationBuffer()
          Get a new aggregation object.
 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 terminatePartial(GenericUDAFEvaluator.AggregationBuffer agg)
          Get partial aggregation result.
 
Methods inherited from class org.apache.hadoop.hive.ql.udf.generic.GenericUDAFEvaluator
aggregate, evaluate, init, terminate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inputOI

protected PrimitiveObjectInspector inputOI

quantilesOI

protected ObjectInspector quantilesOI

nbinsOI

protected PrimitiveObjectInspector nbinsOI

loi

protected StandardListObjectInspector loi
Constructor Detail

GenericUDAFPercentileApprox.GenericUDAFPercentileApproxEvaluator

public GenericUDAFPercentileApprox.GenericUDAFPercentileApproxEvaluator()
Method Detail

merge

public void merge(GenericUDAFEvaluator.AggregationBuffer agg,
                  Object partial)
           throws HiveException
Description copied from class: GenericUDAFEvaluator
Merge with partial aggregation result. NOTE: null might be passed in case there is no input data.

Specified by:
merge in class GenericUDAFEvaluator
partial - The partial aggregation result.
Throws:
HiveException

terminatePartial

public Object terminatePartial(GenericUDAFEvaluator.AggregationBuffer agg)
                        throws HiveException
Description copied from class: GenericUDAFEvaluator
Get partial aggregation result.

Specified by:
terminatePartial in class GenericUDAFEvaluator
Returns:
partial aggregation result.
Throws:
HiveException

iterate

public void iterate(GenericUDAFEvaluator.AggregationBuffer agg,
                    Object[] parameters)
             throws HiveException
Description copied from class: GenericUDAFEvaluator
Iterate through original data.

Specified by:
iterate in class GenericUDAFEvaluator
parameters - The objects of parameters.
Throws:
HiveException

getNewAggregationBuffer

public GenericUDAFEvaluator.AggregationBuffer getNewAggregationBuffer()
                                                               throws HiveException
Description copied from class: GenericUDAFEvaluator
Get a new aggregation object.

Specified by:
getNewAggregationBuffer in class GenericUDAFEvaluator
Throws:
HiveException

reset

public void reset(GenericUDAFEvaluator.AggregationBuffer agg)
           throws HiveException
Description copied from class: GenericUDAFEvaluator
Reset the aggregation. This is useful if we want to reuse the same aggregation.

Specified by:
reset in class GenericUDAFEvaluator
Throws:
HiveException


Copyright © 2011 The Apache Software Foundation