public class MaxTupleBy1stField extends EvalFunc<Tuple> implements Algebraic, Accumulator<Tuple>
| Modifier and Type | Class and Description |
|---|---|
static class |
MaxTupleBy1stField.Final |
static class |
MaxTupleBy1stField.Initial |
static class |
MaxTupleBy1stField.Intermediate |
EvalFunc.SchemaTypelog, pigLogger, reporter, returnType| Constructor and Description |
|---|
MaxTupleBy1stField() |
| Modifier and Type | Method and Description |
|---|---|
void |
accumulate(Tuple b)
Accumulate implementation - calls max() on the incoming tuple set including intermediate tuple if already exists
|
void |
cleanup()
Called after getValue() to prepare processing for next key.
|
Tuple |
exec(Tuple input)
This callback method must be implemented by all subclasses.
|
String |
getFinal()
Get the final function.
|
String |
getInitial()
Get the initial function.
|
String |
getIntermed()
Get the intermediate function.
|
Tuple |
getValue()
Called when all tuples from current key have been passed to accumulate.
|
protected static Tuple |
max(DataBag values,
PigProgressable reporter) |
protected static Tuple |
max(Tuple input,
PigProgressable reporter) |
Schema |
outputSchema(Schema input)
Report the schema of the output of this UDF.
|
allowCompileTimeCalculation, finish, getArgToFuncMapping, getCacheFiles, getInputSchema, getLoadCaster, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, getSchemaType, getShipFiles, isAsynchronous, needEndOfAllInputProcessing, progress, setEndOfAllInput, setInputSchema, setPigLogger, setReporter, setUDFContextSignature, warnpublic 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<Tuple>input - Schema of the inputpublic Tuple exec(Tuple input) throws IOException
EvalFuncexec in class EvalFunc<Tuple>input - the Tuple to be processed.IOExceptionprotected static Tuple max(Tuple input, PigProgressable reporter) throws ExecException
ExecExceptionprotected static Tuple max(DataBag values, PigProgressable reporter) throws ExecException
ExecExceptionpublic String getInitial()
AlgebraicgetInitial in interface Algebraicpublic String getIntermed()
AlgebraicgetIntermed in interface Algebraicpublic String getFinal()
Algebraicpublic void accumulate(Tuple b) throws IOException
accumulate in interface Accumulator<Tuple>b - A tuple containing a single field, which is a bag. The bag will contain the setIOExceptionpublic Tuple getValue()
AccumulatorgetValue in interface Accumulator<Tuple>public void cleanup()
Accumulatorcleanup in interface Accumulator<Tuple>Copyright © 2007-2017 The Apache Software Foundation