org.apache.datasketches.pig.theta

## Class DataToSketch.IntermediateFinal

- java.lang.Object
- - org.apache.pig.EvalFunc<org.apache.pig.data.Tuple>
  - - org.apache.datasketches.pig.theta.DataToSketch.IntermediateFinal

Enclosing class:
  DataToSketch

    public static class DataToSketch.IntermediateFinal
    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
`IntermediateFinal()` Default constructor to make pig validation happy.
`IntermediateFinal(int nomEntries, float p, long seed)` Constructor with primitives for the intermediate and final passes of an Algebraic function.
`IntermediateFinal(String nomEntriesStr)` Constructor for the intermediate and final passes of an Algebraic function.
`IntermediateFinal(String nomEntriesStr, String pStr)` Constructor for the intermediate and final passes of an Algebraic function.
`IntermediateFinal(String nomEntriesStr, String pStr, String seedStr)` Constructor with strings 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)`

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

#### IntermediateFinal

    public IntermediateFinal()

Default constructor to make pig validation happy. Assumes:

- See Default Nominal Entries
- p = 1.0. See Sampling Probability, p.
- See Default Update Seed

#### IntermediateFinal

    public IntermediateFinal(String nomEntriesStr)

Constructor for the intermediate and final passes of an Algebraic function. Pig will call this and pass the same constructor arguments as the base UDF. Assumes:

- p = 1.0. See Sampling Probability, p.
- See Default Update Seed

Parameters:
  `nomEntriesStr` - See Nominal Entries.

#### IntermediateFinal

    public IntermediateFinal(String nomEntriesStr,
                             String pStr)

Constructor for the intermediate and final passes of an Algebraic function. Pig will call this and pass the same constructor arguments as the base UDF. Assumes:

- See Default Update Seed

Parameters:
  `nomEntriesStr` - See Nominal Entries.
  `pStr` - See Sampling Probability, p.

#### IntermediateFinal

    public IntermediateFinal(String nomEntriesStr,
                             String pStr,
                             String seedStr)

Constructor with strings for the intermediate and final passes of an Algebraic function. Pig will call this and pass the same constructor arguments as the original UDF.

Parameters:
  `nomEntriesStr` - See Nominal Entries.
  `pStr` - See Sampling Probability, p.
  `seedStr` - See Update Hash Seed.

#### IntermediateFinal

    public IntermediateFinal(int nomEntries,
                             float p,
                             long seed)

Constructor with primitives for the intermediate and final passes of an Algebraic function. Pig will call this and pass the same constructor arguments as the Top Level UDF.

Parameters:
  `nomEntries` - See Nominal Entries.
  `p` - See Sampling Probability, p.
  `seed` - See Update Hash Seed.

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