public class TOP extends AccumulatorEvalFunc<DataBag> implements Algebraic
Modifier and Type | Class and Description |
---|---|
static class |
TOP.Final |
static class |
TOP.Initial |
static class |
TOP.Intermed |
EvalFunc.SchemaType
pigLogger, reporter, returnType
Modifier and Type | Method and Description |
---|---|
void |
accumulate(Tuple tuple)
Pass tuples to the UDF.
|
void |
cleanup()
Called after getValue() to prepare processing for next key.
|
List<FuncSpec> |
getArgToFuncMapping()
Allow a UDF to specify type specific implementations of itself.
|
String |
getFinal()
Get the final function.
|
String |
getInitial()
Get the initial function.
|
String |
getIntermed()
Get the intermediate function.
|
DataBag |
getValue()
Called when all tuples from current key have been passed to accumulate.
|
Schema |
outputSchema(Schema input)
Report the schema of the output of this UDF.
|
protected static void |
updateTop(PriorityQueue<Tuple> store,
int limit,
DataBag inputBag) |
exec
allowCompileTimeCalculation, finish, getCacheFiles, getInputSchema, getLoadCaster, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, getSchemaType, getShipFiles, isAsynchronous, needEndOfAllInputProcessing, progress, setEndOfAllInput, setInputSchema, setPigLogger, setReporter, setUDFContextSignature, warn
public TOP()
public TOP(String arg)
public void accumulate(Tuple tuple) throws IOException
Accumulator
accumulate
in interface Accumulator<DataBag>
accumulate
in class AccumulatorEvalFunc<DataBag>
tuple
- A tuple containing a single field, which is a bag. The bag will contain the set
of tuples being passed to the UDF in this iteration.IOException
public DataBag getValue()
Accumulator
getValue
in interface Accumulator<DataBag>
getValue
in class AccumulatorEvalFunc<DataBag>
public void cleanup()
Accumulator
cleanup
in interface Accumulator<DataBag>
cleanup
in class AccumulatorEvalFunc<DataBag>
protected static void updateTop(PriorityQueue<Tuple> store, int limit, DataBag inputBag)
public List<FuncSpec> getArgToFuncMapping() throws FrontendException
EvalFunc
getArgToFuncMapping
in class EvalFunc<DataBag>
FrontendException
public Schema outputSchema(Schema input)
EvalFunc
The default implementation interprets the OutputSchema
annotation,
if one is present. Otherwise, it returns null
(no known output schema).
outputSchema
in class EvalFunc<DataBag>
input
- Schema of the inputpublic String getInitial()
Algebraic
getInitial
in interface Algebraic
public String getIntermed()
Algebraic
getIntermed
in interface Algebraic
Copyright © 2007-2017 The Apache Software Foundation