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

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

public class GenericUDAFCount
extends Object
implements GenericUDAFResolver2

This class implements the COUNT aggregation function as in SQL.


Nested Class Summary
static class GenericUDAFCount.GenericUDAFCountEvaluator
          GenericUDAFCountEvaluator.
 
Constructor Summary
GenericUDAFCount()
           
 
Method Summary
 GenericUDAFEvaluator getEvaluator(GenericUDAFParameterInfo paramInfo)
          Get the evaluator for the parameter types.
 GenericUDAFEvaluator getEvaluator(TypeInfo[] parameters)
          Get the evaluator for the parameter types.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericUDAFCount

public GenericUDAFCount()
Method Detail

getEvaluator

public GenericUDAFEvaluator getEvaluator(TypeInfo[] parameters)
                                  throws SemanticException
Description copied from interface: GenericUDAFResolver
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 GenericUDAFResolver
Parameters:
parameters - The types of the parameters. We need the type information to know which evaluator class to use.
Throws:
SemanticException

getEvaluator

public GenericUDAFEvaluator getEvaluator(GenericUDAFParameterInfo paramInfo)
                                  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
Parameters:
paramInfo - The parameter information that is applicable to the UDAF being invoked.
Throws:
SemanticException


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