Generates the maximum of a set of values. This class implements
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.

Constructor Detail

MAX

Method Detail

getArgToFuncMapping

Allow a UDF to specify type specific implementations of itself. For example,
an implementation of arithmetic sum might have int and float implementations,
since integer arithmetic performs much better than floating point arithmetic. Pig's
typechecker will call this method and using the returned list plus the schema
of the function's input data, decide which implementation of the UDF to use.

A List containing FuncSpec objects representing the EvalFunc class
which can handle the inputs corresponding to the schema in the objects. Each
FuncSpec should be constructed with a schema that describes the input for that
implementation. For example, the sum function above would return two elements in its
list: