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.SchemaType
log, 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, warn
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<Tuple>
input
- Schema of the inputpublic Tuple exec(Tuple input) throws IOException
EvalFunc
exec
in class EvalFunc<Tuple>
input
- the Tuple to be processed.IOException
protected static Tuple max(Tuple input, PigProgressable reporter) throws ExecException
ExecException
protected static Tuple max(DataBag values, PigProgressable reporter) throws ExecException
ExecException
public String getInitial()
Algebraic
getInitial
in interface Algebraic
public String getIntermed()
Algebraic
getIntermed
in interface Algebraic
public String getFinal()
Algebraic
public 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 setIOException
public Tuple getValue()
Accumulator
getValue
in interface Accumulator<Tuple>
public void cleanup()
Accumulator
cleanup
in interface Accumulator<Tuple>
Copyright © 2007-2017 The Apache Software Foundation