org.apache.datasketches.pig.tuple

## Class DataToArrayOfDoublesSketch

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

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

    public class DataToArrayOfDoublesSketch
    extends org.apache.pig.EvalFunc<org.apache.pig.data.Tuple>
    implements org.apache.pig.Algebraic

This UDF creates an ArrayOfDoublesSketch from raw data. It supports all three ways: exec(), Accumulator and Algebraic.

### Nested Class Summary

Nested Classes
`static class` `DataToArrayOfDoublesSketch.Initial`
`static class` `DataToArrayOfDoublesSketch.IntermediateFinal`

### 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
`DataToArrayOfDoublesSketch()` Constructor with default sketch size, default sampling probability of 1 and default number of values per key, which is 1.
`DataToArrayOfDoublesSketch(String numValues)` Constructor with default sketch size and default sampling probability of 1.
`DataToArrayOfDoublesSketch(String sketchSize, String numValues)` Constructor with given sketch size, number of values and default sampling probability of 1.
`DataToArrayOfDoublesSketch(String sketchSize, String samplingProbability, String numValues)` Constructor with given sketch size, sampling probability and number of values.

### 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)`
`String` `getFinal()`
`String` `getInitial()`
`String` `getIntermed()`
`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

#### DataToArrayOfDoublesSketch

    public DataToArrayOfDoublesSketch()

Constructor with default sketch size, default sampling probability of 1 and default number of values per key, which is 1.

#### DataToArrayOfDoublesSketch

    public DataToArrayOfDoublesSketch(String numValues)

Constructor with default sketch size and default sampling probability of 1.

Parameters:
  `numValues` - Number of double values to keep for each key

#### DataToArrayOfDoublesSketch

    public DataToArrayOfDoublesSketch(String sketchSize,
                                      String numValues)

Constructor with given sketch size, number of values and default sampling probability of 1.

Parameters:
  `sketchSize` - String representation of sketch size
  `numValues` - Number of double values to keep for each key

#### DataToArrayOfDoublesSketch

    public DataToArrayOfDoublesSketch(String sketchSize,
                                      String samplingProbability,
                                      String numValues)

Constructor with given sketch size, sampling probability and number of values.

Parameters:
  `sketchSize` - String representation of sketch size
  `samplingProbability` - probability from 0 to 1
  `numValues` - Number of double values to keep for each key

### Method Detail

#### getInitial

    public String getInitial()

Specified by:
  `getInitial` in interface `org.apache.pig.Algebraic`

#### getIntermed

    public String getIntermed()

Specified by:
  `getIntermed` in interface `org.apache.pig.Algebraic`

#### getFinal

    public String getFinal()

Specified by:
  `getFinal` in interface `org.apache.pig.Algebraic`

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