org.apache.hive.builtins
Class UDAFUnionMap

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

public class UDAFUnionMap
extends AbstractGenericUDAFResolver

Aggregate all maps into a single map. If there are multiple values for the same key, result can contain any of those values. Because the mappers must keep all of the data in memory, if your data is non-trivially large you should set hive.map.aggr=false to ensure that UNION_MAP is only executed in the reduce phase.


Nested Class Summary
static class UDAFUnionMap.Evaluator
           
static class UDAFUnionMap.State
           
 
Constructor Summary
UDAFUnionMap()
           
 
Method Summary
 GenericUDAFEvaluator getEvaluator(TypeInfo[] parameters)
          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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UDAFUnionMap

public UDAFUnionMap()
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
Overrides:
getEvaluator in class AbstractGenericUDAFResolver
Parameters:
parameters - The types of the parameters. We need the type information to know which evaluator class to use.
Throws:
SemanticException


Copyright © 2013 The Apache Software Foundation