org.apache.hadoop.hive.ql.udf.generic
Interface GenericUDAFResolver
- All Known Implementing Classes:
- GenericUDAFAverage, GenericUDAFBridge, GenericUDAFCount, GenericUDAFStd, GenericUDAFStdSample, GenericUDAFSum, GenericUDAFVariance, GenericUDAFVarianceSample
public interface GenericUDAFResolver
A Generic User-defined aggregation function (GenericUDAF) for the use with
Hive.
GenericUDAFResolver is used at compile time. We use GenericUDAFResolver to
find out the GenericUDAFEvaluator for the parameter types.
getEvaluator
GenericUDAFEvaluator getEvaluator(TypeInfo[] parameters)
throws SemanticException
- Get the evaluator for the parameter types.
The reason that this function returns an object instead of a class
is because it's 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.
- Parameters:
parameters
- The types of the parameters. We need the type
information to know which evaluator class to use.
- Throws:
SemanticException
Copyright © 2009 The Apache Software Foundation