org.apache.datasketches.pig.quantiles

## Class DataToItemsSketch.DataToItemsSketchIntermediateFinal<T>

- java.lang.Object
- - org.apache.pig.EvalFunc<org.apache.pig.data.Tuple>
  - - org.apache.datasketches.pig.quantiles.DataToItemsSketch.DataToItemsSketchIntermediateFinal<T>

Type Parameters:
  `T` - type of item

Direct Known Subclasses:
  DataToStringsSketch.DataToStringsSketchIntermediateFinal

Enclosing class:
  DataToItemsSketch<T>

    public abstract static class DataToItemsSketch.DataToItemsSketchIntermediateFinal<T>
    extends org.apache.pig.EvalFunc<org.apache.pig.data.Tuple>

Class used to calculate the intermediate or final combiner pass of an Algebraic sketch operation. This is called from the combiner, and may be called multiple times (from the mapper and from the reducer). It will receive a bag of values returned by either the Intermediate stage or the Initial stages, so it needs to be able to differentiate between and interpret both types.

### Nested Class Summary

### Nested classes/interfaces inherited from class org.apache.pig.EvalFunc

`org.apache.pig.EvalFunc.SchemaType`

### Field Summary

### Fields inherited from class org.apache.pig.EvalFunc

`log, pigLogger, reporter, returnType`

### Constructor Summary

Constructors
Constructor and Description
`DataToItemsSketchIntermediateFinal(int k, Comparator<T> comparator, org.apache.datasketches.ArrayOfItemsSerDe<T> serDe)` Constructor for the intermediate and final passes of an Algebraic function.

### Method Summary

All Methods Instance Methods Concrete Methods
`org.apache.pig.data.Tuple` `exec(org.apache.pig.data.Tuple inputTuple)`
`protected T` `extractValue(Object object)` Override this if it takes more than a cast to convert from Pig type to type T

### Methods inherited from class org.apache.pig.EvalFunc

`allowCompileTimeCalculation, finish, getArgToFuncMapping, getCacheFiles, getInputSchema, getLoadCaster, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, getSchemaType, getShipFiles, isAsynchronous, needEndOfAllInputProcessing, outputSchema, progress, setEndOfAllInput, setInputSchema, setPigLogger, setReporter, setUDFContextSignature, warn`

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

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

### Constructor Detail

#### DataToItemsSketchIntermediateFinal

    public DataToItemsSketchIntermediateFinal(int k,
                                              Comparator<T> comparator,
                                              org.apache.datasketches.ArrayOfItemsSerDe<T> serDe)

Constructor for the intermediate and final passes of an Algebraic function.

Parameters:
  `k` - parameter that determines the accuracy and size of the sketch.
  `comparator` - for items of type T
  `serDe` - an instance of ArrayOfItemsSerDe for type T

### Method Detail

#### extractValue

    protected T extractValue(Object object)

Override this if it takes more than a cast to convert from Pig type to type T

Parameters:
  `object` - Pig object, which needs to be converted to type T
Returns:
  value of type T

#### exec

    public org.apache.pig.data.Tuple exec(org.apache.pig.data.Tuple inputTuple)
                                   throws IOException

Specified by:
  `exec` in class `org.apache.pig.EvalFunc<org.apache.pig.data.Tuple>`
Throws:
  `IOException`