@Internal public final class MaxWithRetractAggFunction<T extends Comparable<T>> extends InternalAggregateFunction<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() |
DataType[] |
getInputDataTypes() |
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) |
getTypeInference
getKind
getAccumulatorType, getResultType
close, functionIdentifier, open, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getRequirements, isDeterministic
public MaxWithRetractAggFunction(LogicalType valueType)
public DataType[] getInputDataTypes()
getInputDataTypes
in class InternalAggregateFunction<T extends Comparable<T>,MaxWithRetractAggFunction.MaxWithRetractAccumulator<T extends Comparable<T>>>
public DataType getAccumulatorDataType()
getAccumulatorDataType
in class InternalAggregateFunction<T extends Comparable<T>,MaxWithRetractAggFunction.MaxWithRetractAccumulator<T extends Comparable<T>>>
public DataType getOutputDataType()
getOutputDataType
in class InternalAggregateFunction<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–2021 The Apache Software Foundation. All rights reserved.