Package org.apache.datasketches.hive.theta

## Class UnionSketchUDAF.UnionSketchUDAFEvaluator

- java.lang.Object
- - org.apache.hadoop.hive.ql.udf.generic.GenericUDAFEvaluator
  - - org.apache.datasketches.hive.theta.UnionEvaluator
    - - org.apache.datasketches.hive.theta.UnionSketchUDAF.UnionSketchUDAFEvaluator

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`

Enclosing class:
  UnionSketchUDAF

    public static class UnionSketchUDAF.UnionSketchUDAFEvaluator
    extends UnionEvaluator

Evaluator class of Generic UDAF, main logic of our UDAF.

### Nested Class Summary

### Nested classes/interfaces inherited from class org.apache.hadoop.hive.ql.udf.generic.GenericUDAFEvaluator

`org.apache.hadoop.hive.ql.udf.generic.GenericUDAFEvaluator.AbstractAggregationBuffer, org.apache.hadoop.hive.ql.udf.generic.GenericUDAFEvaluator.AggregationBuffer, org.apache.hadoop.hive.ql.udf.generic.GenericUDAFEvaluator.AggregationType, org.apache.hadoop.hive.ql.udf.generic.GenericUDAFEvaluator.Mode`

### Field Summary

### Fields inherited from class org.apache.datasketches.hive.theta.UnionEvaluator

`inputObjectInspector, intermediateObjectInspector, NOMINAL_ENTRIES_FIELD, nominalEntriesObjectInspector, SEED_FIELD, seedObjectInspector, SKETCH_FIELD`

### Fields inherited from class org.apache.hadoop.hive.ql.udf.generic.GenericUDAFEvaluator

`partitionEvaluator`

### Constructor Summary

Constructors
`UnionSketchUDAFEvaluator()`

### Method Summary

All Methods Instance Methods Concrete Methods
`org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector` `init​(org.apache.hadoop.hive.ql.udf.generic.GenericUDAFEvaluator.Mode mode, org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector[] parameters)` Receives the passed in argument object inspectors and returns the desired return type's object inspector to inform hive of return type of UDAF.
`void` `iterate​(org.apache.hadoop.hive.ql.udf.generic.GenericUDAFEvaluator.AggregationBuffer agg, Object[] parameters)` Add the incoming sketch into the internal state.

### Methods inherited from class org.apache.datasketches.hive.theta.UnionEvaluator

`getNewAggregationBuffer, merge, reset, terminate, terminatePartial`

### Methods inherited from class org.apache.hadoop.hive.ql.udf.generic.GenericUDAFEvaluator

`aggregate, close, configure, createPartitionEvaluator, estimate, evaluate, getExprString, getPartitionWindowingEvaluator, getWindowingEvaluator, isEstimable`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### UnionSketchUDAFEvaluator

    public UnionSketchUDAFEvaluator()

### Method Detail

#### init

    public org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector init​(org.apache.hadoop.hive.ql.udf.generic.GenericUDAFEvaluator.Mode mode,
                                                                              org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector[] parameters)
                                                                       throws org.apache.hadoop.hive.ql.metadata.HiveException

Receives the passed in argument object inspectors and returns the desired return type's object inspector to inform hive of return type of UDAF.

Overrides:
  `init` in class `org.apache.hadoop.hive.ql.udf.generic.GenericUDAFEvaluator`
Parameters:
  `mode` - Mode (i.e. PARTIAL 1, COMPLETE...) for determining input/output object inspector type.
  `parameters` - List of object inspectors for input arguments.
Returns:
  The object inspector type indicates the UDAF return type (i.e. returned type of terminate(...)).
Throws:
  `org.apache.hadoop.hive.ql.metadata.HiveException`

#### iterate

    public void iterate​(org.apache.hadoop.hive.ql.udf.generic.GenericUDAFEvaluator.AggregationBuffer agg,
                        Object[] parameters)
                 throws org.apache.hadoop.hive.ql.metadata.HiveException

Add the incoming sketch into the internal state.

Specified by:
  `iterate` in class `org.apache.hadoop.hive.ql.udf.generic.GenericUDAFEvaluator`
Parameters:
  `agg` - aggregation buffer storing intermediate results.
  `parameters` - sketches in the form of Object passed in to be merged.
Throws:
  `org.apache.hadoop.hive.ql.metadata.HiveException`