public class UnionSketch
extends org.apache.pig.EvalFunc<org.apache.pig.data.DataByteArray>
implements org.apache.pig.Accumulator<org.apache.pig.data.DataByteArray>, org.apache.pig.Algebraic
Constructor and Description |
---|
UnionSketch()
Constructor with default lgK and target HLL type
|
UnionSketch(int lgK,
long seed)
Base constructor.
|
UnionSketch(String lgK)
Constructor with given lgK as string and default seed.
|
UnionSketch(String lgK,
String seed)
Constructor with given lgK and seed as strings
|
Modifier and Type | Method and Description |
---|---|
void |
accumulate(org.apache.pig.data.Tuple inputTuple)
An Accumulator version of the standard exec() method.
|
void |
cleanup()
Cleans up the UDF state after being called using the
Accumulator interface. |
org.apache.pig.data.DataByteArray |
exec(org.apache.pig.data.Tuple inputTuple)
Top-level exec function.
|
String |
getFinal() |
String |
getInitial() |
String |
getIntermed() |
org.apache.pig.data.DataByteArray |
getValue()
Returns the sketch that has been built up by multiple calls to
accumulate(org.apache.pig.data.Tuple) . |
allowCompileTimeCalculation, finish, getArgToFuncMapping, getCacheFiles, getInputSchema, getLoadCaster, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, getSchemaType, getShipFiles, isAsynchronous, needEndOfAllInputProcessing, outputSchema, progress, setEndOfAllInput, setInputSchema, setPigLogger, setReporter, setUDFContextSignature, warn
public UnionSketch()
public UnionSketch(String lgK)
lgK
- in a form of a Stringpublic UnionSketch(String lgK, String seed)
lgK
- in a form of a Stringseed
- in a form of a Stringpublic UnionSketch(int lgK, long seed)
lgK
- parameter controlling the sketch size and accuracyseed
- for the hash functionpublic org.apache.pig.data.DataByteArray exec(org.apache.pig.data.Tuple inputTuple) throws IOException
exec
in class org.apache.pig.EvalFunc<org.apache.pig.data.DataByteArray>
inputTuple
- A tuple containing a single bag, containing Sketch Tuples.IOException
- from Pig.public void accumulate(org.apache.pig.data.Tuple inputTuple) throws IOException
accumulate
in interface org.apache.pig.Accumulator<org.apache.pig.data.DataByteArray>
inputTuple
- A tuple containing a single bag, containing Sketch Tuples.IOException
- by Pigexec(org.apache.pig.data.Tuple)
,
"org.apache.pig.Accumulator.accumulate(org.apache.pig.data.Tuple)"public org.apache.pig.data.DataByteArray getValue()
accumulate(org.apache.pig.data.Tuple)
.getValue
in interface org.apache.pig.Accumulator<org.apache.pig.data.DataByteArray>
exec(org.apache.pig.data.Tuple)
for return tuple format)public void cleanup()
Accumulator
interface.cleanup
in interface org.apache.pig.Accumulator<org.apache.pig.data.DataByteArray>
public String getInitial()
getInitial
in interface org.apache.pig.Algebraic
public String getIntermed()
getIntermed
in interface org.apache.pig.Algebraic
public String getFinal()
getFinal
in interface org.apache.pig.Algebraic
Copyright © 2015–2019 The Apache Software Foundation. All rights reserved.