NaN
iff all values are NaN
(i.e. NaN
values have no impact on the value of the statistic).Double.POSITIVE_INFINITY
, the result is Double.POSITIVE_INFINITY.
Note that this implementation is not synchronized. If multiple threads access an instance of this class concurrently, and at least one of the threads invokes the increment()
or clear()
method, it must be synchronized externally.
NaN
iff all values are NaN
(i.e. NaN
values have no impact on the value of the statistic).Double.POSITIVE_INFINITY
, the result is Double.POSITIVE_INFINITY.
Note that this implementation is not synchronized. If multiple threads access an instance of this class concurrently, and at least one of the threads invokes the increment()
or clear()
method, it must be synchronized externally.
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 {@link org.apache.pig.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.
value
- Tuple containing two double
.double
register math.jar;
A = load 'mydata' using PigStorage() as ( float1 );
B = foreach A generate float1, math.MAX(float1);
|
|
|
|
|
|
|
|
|
|
|
|