org.apache.datasketches.pig.tuple

## Class UnionSketchAlgebraicIntermediateFinal<S extends org.apache.datasketches.tuple.Summary>

- java.lang.Object
- - org.apache.pig.EvalFunc<org.apache.pig.data.Tuple>
  - - org.apache.datasketches.pig.tuple.UnionSketchAlgebraicIntermediateFinal<S>

Type Parameters:
  `S` - Type of Summary

Direct Known Subclasses:
  UnionDoubleSummarySketch.IntermediateFinal

    public abstract class UnionSketchAlgebraicIntermediateFinal<S extends org.apache.datasketches.tuple.Summary>
    extends org.apache.pig.EvalFunc<org.apache.pig.data.Tuple>

This is to calculate the intermediate pass (combiner) or the final pass (reducer) of an Algebraic sketch operation. This may be called multiple times (from the mapper and from the reducer). It will receive a bag of values returned by either the Intermediate 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
`UnionSketchAlgebraicIntermediateFinal(int sketchSize, org.apache.datasketches.tuple.SummarySetOperations<S> summarySetOps, org.apache.datasketches.tuple.SummaryDeserializer<S> summaryDeserializer)` Constructs a function given a sketch size and summary factory
`UnionSketchAlgebraicIntermediateFinal(org.apache.datasketches.tuple.SummarySetOperations<S> summarySetOps, org.apache.datasketches.tuple.SummaryDeserializer<S> summaryDeserializer)` Constructs a function given a summary factory and default sketch size

### Method Summary

All Methods Instance Methods Concrete Methods
`org.apache.pig.data.Tuple` `exec(org.apache.pig.data.Tuple inputTuple)`

### 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

#### UnionSketchAlgebraicIntermediateFinal

    public UnionSketchAlgebraicIntermediateFinal(org.apache.datasketches.tuple.SummarySetOperations<S> summarySetOps,
                                                 org.apache.datasketches.tuple.SummaryDeserializer<S> summaryDeserializer)

Constructs a function given a summary factory and default sketch size

Parameters:
  `summarySetOps` - an instance of SummarySetOperations
  `summaryDeserializer` - an instance of SummaryDeserializer

#### UnionSketchAlgebraicIntermediateFinal

    public UnionSketchAlgebraicIntermediateFinal(int sketchSize,
                                                 org.apache.datasketches.tuple.SummarySetOperations<S> summarySetOps,
                                                 org.apache.datasketches.tuple.SummaryDeserializer<S> summaryDeserializer)

Constructs a function given a sketch size and summary factory

Parameters:
  `sketchSize` - parameter controlling the size of the sketch and the accuracy. It represents nominal number of entries in the sketch. Forced to the nearest power of 2 greater than given value.
  `summarySetOps` - an instance of SummarySetOperations
  `summaryDeserializer` - an instance of SummaryDeserializer

### Method Detail

#### 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`