@Internal public final class MaxWithRetractAggFunction<T extends Comparable<T>> extends BuiltInAggregateFunction<T,MaxWithRetractAggFunction.MaxWithRetractAccumulator<T>>
Modifier and Type | Class and Description |
---|---|
static class |
MaxWithRetractAggFunction.MaxWithRetractAccumulator<T>
Accumulator for MAX with retraction.
|
Constructor and Description |
---|
MaxWithRetractAggFunction(LogicalType valueType) |
Modifier and Type | Method and Description |
---|---|
void |
accumulate(MaxWithRetractAggFunction.MaxWithRetractAccumulator<T> acc,
T value) |
MaxWithRetractAggFunction.MaxWithRetractAccumulator<T> |
createAccumulator()
Creates and initializes the accumulator for this
ImperativeAggregateFunction . |
DataType |
getAccumulatorDataType() |
List<DataType> |
getArgumentDataTypes() |
DataType |
getOutputDataType() |
T |
getValue(MaxWithRetractAggFunction.MaxWithRetractAccumulator<T> acc)
Called every time when an aggregation result should be materialized.
|
void |
merge(MaxWithRetractAggFunction.MaxWithRetractAccumulator<T> acc,
Iterable<MaxWithRetractAggFunction.MaxWithRetractAccumulator<T>> its) |
void |
resetAccumulator(MaxWithRetractAggFunction.MaxWithRetractAccumulator<T> acc) |
void |
retract(MaxWithRetractAggFunction.MaxWithRetractAccumulator<T> acc,
T value) |
getRequirements, getTypeInference, isDeterministic
getKind
getAccumulatorType, getResultType
close, functionIdentifier, open, toString
public MaxWithRetractAggFunction(LogicalType valueType)
public List<DataType> getArgumentDataTypes()
getArgumentDataTypes
in class BuiltInAggregateFunction<T extends Comparable<T>,MaxWithRetractAggFunction.MaxWithRetractAccumulator<T extends Comparable<T>>>
public DataType getAccumulatorDataType()
getAccumulatorDataType
in class BuiltInAggregateFunction<T extends Comparable<T>,MaxWithRetractAggFunction.MaxWithRetractAccumulator<T extends Comparable<T>>>
public DataType getOutputDataType()
getOutputDataType
in class BuiltInAggregateFunction<T extends Comparable<T>,MaxWithRetractAggFunction.MaxWithRetractAccumulator<T extends Comparable<T>>>
public MaxWithRetractAggFunction.MaxWithRetractAccumulator<T> createAccumulator()
ImperativeAggregateFunction
ImperativeAggregateFunction
.
The accumulator is an intermediate data structure that stores the aggregated values until a final aggregation result is computed.
createAccumulator
in class ImperativeAggregateFunction<T extends Comparable<T>,MaxWithRetractAggFunction.MaxWithRetractAccumulator<T extends Comparable<T>>>
public void accumulate(MaxWithRetractAggFunction.MaxWithRetractAccumulator<T> acc, T value) throws Exception
Exception
public void retract(MaxWithRetractAggFunction.MaxWithRetractAccumulator<T> acc, T value) throws Exception
Exception
public void merge(MaxWithRetractAggFunction.MaxWithRetractAccumulator<T> acc, Iterable<MaxWithRetractAggFunction.MaxWithRetractAccumulator<T>> its) throws Exception
Exception
public void resetAccumulator(MaxWithRetractAggFunction.MaxWithRetractAccumulator<T> acc)
public T getValue(MaxWithRetractAggFunction.MaxWithRetractAccumulator<T> acc)
AggregateFunction
getValue
in class AggregateFunction<T extends Comparable<T>,MaxWithRetractAggFunction.MaxWithRetractAccumulator<T extends Comparable<T>>>
acc
- the accumulator which contains the current intermediate resultsCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.