org.apache.datasketches.pig.theta

## Class ErrorBounds

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

    public class ErrorBounds
    extends org.apache.pig.EvalFunc<org.apache.pig.data.Tuple>

This is a User Defined Function (UDF) for returning the Double value result along with a lower and upper bound. Refer to `DataToSketch.exec(Tuple)` for the definition of a Sketch Tuple.

Sketch Result Tuple

- Tuple: TUPLE (Contains 3 fields)
  - index 0: Double: DOUBLE: The Estimation Result
  - index 1: Double: DOUBLE: The Upper Bound of the Estimation Result at 95.4% confidence.
  - index 2: Double: DOUBLE: The Lower Bound of the Estimation Result at 95.4% confidence.

### 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
`ErrorBounds()` Constructs with the DEFAULT_UPDATE_SEED used when deserializing the sketch.
`ErrorBounds(long seed)` Constructs with the given seed.
`ErrorBounds(String seedStr)` Constructs with the given seed.

### Method Summary

All Methods Instance Methods Concrete Methods
`org.apache.pig.data.Tuple` `exec(org.apache.pig.data.Tuple sketchTuple)`
`org.apache.pig.impl.logicalLayer.schema.Schema` `outputSchema(org.apache.pig.impl.logicalLayer.schema.Schema input)` The output is a Sketch Result Tuple Schema.

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

`allowCompileTimeCalculation, finish, getArgToFuncMapping, getCacheFiles, getInputSchema, getLoadCaster, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, getSchemaType, getShipFiles, isAsynchronous, needEndOfAllInputProcessing, 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

#### ErrorBounds

    public ErrorBounds()

Constructs with the DEFAULT_UPDATE_SEED used when deserializing the sketch.

#### ErrorBounds

    public ErrorBounds(String seedStr)

Constructs with the given seed.

Parameters:
  `seedStr` - the string seed used when deserializing the sketch.

#### ErrorBounds

    public ErrorBounds(long seed)

Constructs with the given seed.

Parameters:
  `seed` - used when deserializing the sketch.

### Method Detail

#### exec

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

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

#### outputSchema

    public org.apache.pig.impl.logicalLayer.schema.Schema outputSchema(org.apache.pig.impl.logicalLayer.schema.Schema input)

The output is a Sketch Result Tuple Schema.

Overrides:
  `outputSchema` in class `org.apache.pig.EvalFunc<org.apache.pig.data.Tuple>`