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

java.lang.Object
  extended by org.apache.hadoop.hive.ql.udf.generic.AbstractGenericUDAFResolver
      extended by org.apache.hadoop.hive.ql.udf.generic.GenericUDAFPercentileApprox
All Implemented Interfaces:
GenericUDAFResolver, GenericUDAFResolver2

public class GenericUDAFPercentileApprox
extends AbstractGenericUDAFResolver

Computes an approximate percentile (quantile) from an approximate histogram, for very large numbers of rows where the regular percentile() UDAF might run out of memory. The input is a single double value or an array of double values representing the quantiles requested. The output, corresponding to the input, is either an single double value or an array of doubles that are the quantile values.


Nested Class Summary
static class GenericUDAFPercentileApprox.GenericUDAFMultiplePercentileApproxEvaluator
           
static class GenericUDAFPercentileApprox.GenericUDAFPercentileApproxEvaluator
          Construct a histogram using the algorithm described by Ben-Haim and Tom-Tov, and then use it to compute an approximate percentile value.
static class GenericUDAFPercentileApprox.GenericUDAFSinglePercentileApproxEvaluator
           
 
Constructor Summary
GenericUDAFPercentileApprox()
           
 
Method Summary
 GenericUDAFEvaluator getEvaluator(GenericUDAFParameterInfo info)
          Get the evaluator for the parameter types.
 
Methods inherited from class org.apache.hadoop.hive.ql.udf.generic.AbstractGenericUDAFResolver
getEvaluator
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericUDAFPercentileApprox

public GenericUDAFPercentileApprox()
Method Detail

getEvaluator

public GenericUDAFEvaluator getEvaluator(GenericUDAFParameterInfo info)
                                  throws SemanticException
Description copied from interface: GenericUDAFResolver2
Get the evaluator for the parameter types. The reason that this function returns an object instead of a class is because it is possible that the object needs some configuration (that can be serialized). In that case the class of the object has to implement the Serializable interface. At execution time, we will deserialize the object from the plan and use it to evaluate the aggregations.

If the class of the object does not implement Serializable, then we will create a new instance of the class at execution time.

Specified by:
getEvaluator in interface GenericUDAFResolver2
Overrides:
getEvaluator in class AbstractGenericUDAFResolver
Parameters:
info - The parameter information that is applicable to the UDAF being invoked.
Throws:
SemanticException


Copyright © 2014 The Apache Software Foundation. All rights reserved.