public class MAX extends AlgebraicByteArrayMathBase
Algebraic
, so if possible the execution will
performed in a distributed fashion.
MAX can operate on any numeric type and on chararrays. It can also operate on bytearrays, which it will cast to doubles. It expects a bag of tuples of one record each. If Pig knows from the schema that this function will be passed a bag of integers or longs, it will use a specially adapted version of MAX that uses integer arithmetic for comparing the data. The return type of MAX will match the input type.
MAX implements the Accumulator
interface as well.
While this will never be
the preferred method of usage it is available in case the combiner can not be
used for a given calculation.
Modifier and Type | Class and Description |
---|---|
protected static class |
AlgebraicMathBase.KNOWN_OP |
protected static interface |
AlgebraicMathBase.KnownOpProvider |
static class |
MAX.Final |
static class |
MAX.Intermediate |
AlgebraicByteArrayMathBase.Initial
EvalFunc.SchemaType
Modifier and Type | Field and Description |
---|---|
protected AlgebraicMathBase.KnownOpProvider |
opProvider |
log, pigLogger, reporter, returnType
Constructor and Description |
---|
MAX() |
Modifier and Type | Method and Description |
---|---|
java.util.List<FuncSpec> |
getArgToFuncMapping()
Allow a UDF to specify type specific implementations of itself.
|
java.lang.String |
getFinal()
Get the final function.
|
java.lang.String |
getIntermed()
Get the intermediate function.
|
protected void |
setOp(AlgebraicMathBase.KNOWN_OP op) |
accumulate, cleanup, doTupleWork, exec, getInitial, getSeed, getValue, outputSchema
allowCompileTimeCalculation, finish, getCacheFiles, getInputSchema, getLoadCaster, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, getSchemaType, getShipFiles, isAsynchronous, needEndOfAllInputProcessing, progress, setEndOfAllInput, setInputSchema, setPigLogger, setReporter, setUDFContextSignature, warn
protected AlgebraicMathBase.KnownOpProvider opProvider
public java.util.List<FuncSpec> getArgToFuncMapping() throws FrontendException
EvalFunc
getArgToFuncMapping
in class EvalFunc<java.lang.Double>
FrontendException
protected void setOp(AlgebraicMathBase.KNOWN_OP op)
public java.lang.String getIntermed()
Algebraic
getIntermed
in interface Algebraic
public java.lang.String getFinal()
Algebraic
Copyright © 2007-2017 The Apache Software Foundation