@Internal public class SumAggregator<T> extends AggregationFunction<T>
AggregationFunction
that sums up fields.AggregationFunction.AggregationType
Constructor and Description |
---|
SumAggregator(int pos,
TypeInformation<T> typeInfo,
ExecutionConfig config) |
SumAggregator(String field,
TypeInformation<T> typeInfo,
ExecutionConfig config) |
Modifier and Type | Method and Description |
---|---|
T |
reduce(T value1,
T value2)
The core method of ReduceFunction, combining two values into one value of the same type.
|
public SumAggregator(int pos, TypeInformation<T> typeInfo, ExecutionConfig config)
public SumAggregator(String field, TypeInformation<T> typeInfo, ExecutionConfig config)
public T reduce(T value1, T value2) throws Exception
ReduceFunction
value1
- The first value to combine.value2
- The second value to combine.Exception
- This method may throw exceptions. Throwing an exception will cause the
operation to fail and may trigger recovery.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.