org.apache.datasketches.pig.frequencies

## Class DataToFrequentItemsSketch<T>

- java.lang.Object
- - org.apache.pig.EvalFunc<org.apache.pig.data.Tuple>
  - - org.apache.datasketches.pig.frequencies.DataToFrequentItemsSketch<T>

Type Parameters:
  `T` - type of item

All Implemented Interfaces:
  org.apache.pig.Accumulator<org.apache.pig.data.Tuple>

Direct Known Subclasses:
  DataToFrequentStringsSketch

    public abstract class DataToFrequentItemsSketch<T>
    extends org.apache.pig.EvalFunc<org.apache.pig.data.Tuple>
    implements org.apache.pig.Accumulator<org.apache.pig.data.Tuple>

This is a generic implementation to be specialized in concrete UDFs

### 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
`DataToFrequentItemsSketch(int sketchSize, org.apache.datasketches.ArrayOfItemsSerDe<T> serDe)` Constructs a function given a sketch size and serde

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `accumulate(org.apache.pig.data.Tuple inputTuple)`
`void` `cleanup()`
`org.apache.pig.data.Tuple` `exec(org.apache.pig.data.Tuple inputTuple)`
`org.apache.pig.data.Tuple` `getValue()`

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

#### DataToFrequentItemsSketch

    public DataToFrequentItemsSketch(int sketchSize,
                                     org.apache.datasketches.ArrayOfItemsSerDe<T> serDe)

Constructs a function given a sketch size and serde

Parameters:
  `sketchSize` - parameter controlling the size of the sketch and the accuracy
  `serDe` - an instance of ArrayOfItemsSerDe to serialize and deserialize arrays of items

### Method Detail

#### accumulate

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

Specified by:
  `accumulate` in interface `org.apache.pig.Accumulator<org.apache.pig.data.Tuple>`
Throws:
  `IOException`

#### cleanup

    public void cleanup()

Specified by:
  `cleanup` in interface `org.apache.pig.Accumulator<org.apache.pig.data.Tuple>`

#### getValue

    public org.apache.pig.data.Tuple getValue()

Specified by:
  `getValue` in interface `org.apache.pig.Accumulator<org.apache.pig.data.Tuple>`

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