org.apache.datasketches.pig.theta

## Class AexcludeB

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

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

This is a Pig UDF that performs the A-NOT-B Set Operation on two given Sketches. Because this operation is fundamentally asymmetric, it is structured as a single stateless operation rather than stateful as are Union and Intersection UDFs, which can be iterative. The requirement to perform iterative A\B\C\... is rare. If needed, it can be rendered easily by the caller.

### 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
`AexcludeB()` Default constructor to make pig validation happy.
`AexcludeB(long seed)` Base constructor.
`AexcludeB(String seedStr)` String constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`org.apache.pig.data.Tuple` `exec(org.apache.pig.data.Tuple inputTuple)` Top Level Exec Function.
`org.apache.pig.impl.logicalLayer.schema.Schema` `outputSchema(org.apache.pig.impl.logicalLayer.schema.Schema input)`

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

#### AexcludeB

    public AexcludeB()

Default constructor to make pig validation happy. Assumes:

- See Default Update Seed

#### AexcludeB

    public AexcludeB(String seedStr)

String constructor.

Parameters:
  `seedStr` - See Update Hash Seed

#### AexcludeB

    public AexcludeB(long seed)

Base constructor.

Parameters:
  `seed` - See Update Hash Seed.

### Method Detail

#### exec

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

Top Level Exec Function.

This method accepts a Sketch AnotB Input Tuple and returns a Sketch Tuple.

Sketch AnotB Input Tuple

- Tuple: TUPLE (Must contain 2 fields):
  Java data type: Pig DataType: Description
  - index 0: DataByteArray: BYTEARRAY: Sketch A
  - index 1: DataByteArray: BYTEARRAY: Sketch B

Any other input tuple will throw an exception!

Sketch Tuple

- Tuple: TUPLE (Contains exactly 1 field)
  - index 0: DataByteArray: BYTEARRAY = The serialization of a Sketch object.

Specified by:
  `exec` in class `org.apache.pig.EvalFunc<org.apache.pig.data.Tuple>`
Throws:
  `org.apache.pig.backend.executionengine.ExecException` - from Pig.
  `IOException`

#### outputSchema

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

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