Class LastValueWithRetractAggFunction<T>
- java.lang.Object
-
- org.apache.flink.table.functions.UserDefinedFunction
-
- org.apache.flink.table.functions.ImperativeAggregateFunction<T,ACC>
-
- org.apache.flink.table.functions.AggregateFunction<T,ACC>
-
- org.apache.flink.table.runtime.functions.aggregate.BuiltInAggregateFunction<T,LastValueWithRetractAggFunction.LastValueWithRetractAccumulator<T>>
-
- org.apache.flink.table.runtime.functions.aggregate.LastValueWithRetractAggFunction<T>
-
- All Implemented Interfaces:
Serializable
,FunctionDefinition
@Internal public final class LastValueWithRetractAggFunction<T> extends BuiltInAggregateFunction<T,LastValueWithRetractAggFunction.LastValueWithRetractAccumulator<T>>
Built-in LAST_VALUE with retraction aggregate function.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LastValueWithRetractAggFunction.LastValueWithRetractAccumulator<T>
Accumulator for LAST_VALUE with retraction.
-
Constructor Summary
Constructors Constructor Description LastValueWithRetractAggFunction(LogicalType valueType)
-
Method Summary
-
Methods inherited from class org.apache.flink.table.runtime.functions.aggregate.BuiltInAggregateFunction
getRequirements, getTypeInference, isDeterministic
-
Methods inherited from class org.apache.flink.table.functions.AggregateFunction
getKind
-
Methods inherited from class org.apache.flink.table.functions.ImperativeAggregateFunction
getAccumulatorType, getResultType
-
Methods inherited from class org.apache.flink.table.functions.UserDefinedFunction
close, functionIdentifier, open, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.flink.table.functions.FunctionDefinition
supportsConstantFolding
-
-
-
-
Constructor Detail
-
LastValueWithRetractAggFunction
public LastValueWithRetractAggFunction(LogicalType valueType)
-
-
Method Detail
-
getAccumulatorDataType
public DataType getAccumulatorDataType()
-
getOutputDataType
public DataType getOutputDataType()
- Overrides:
getOutputDataType
in classBuiltInAggregateFunction<T,LastValueWithRetractAggFunction.LastValueWithRetractAccumulator<T>>
-
createAccumulator
public LastValueWithRetractAggFunction.LastValueWithRetractAccumulator<T> createAccumulator()
Description copied from class:ImperativeAggregateFunction
Creates and initializes the accumulator for thisImperativeAggregateFunction
.The accumulator is an intermediate data structure that stores the aggregated values until a final aggregation result is computed.
- Specified by:
createAccumulator
in classImperativeAggregateFunction<T,LastValueWithRetractAggFunction.LastValueWithRetractAccumulator<T>>
- Returns:
- the accumulator with the initial value
-
accumulate
public void accumulate(LastValueWithRetractAggFunction.LastValueWithRetractAccumulator<T> acc, Object value) throws Exception
- Throws:
Exception
-
accumulate
public void accumulate(LastValueWithRetractAggFunction.LastValueWithRetractAccumulator<T> acc, Object value, Long order) throws Exception
- Throws:
Exception
-
accumulate
public void accumulate(LastValueWithRetractAggFunction.LastValueWithRetractAccumulator<T> acc, StringData value) throws Exception
- Throws:
Exception
-
accumulate
public void accumulate(LastValueWithRetractAggFunction.LastValueWithRetractAccumulator<T> acc, StringData value, Long order) throws Exception
- Throws:
Exception
-
retract
public void retract(LastValueWithRetractAggFunction.LastValueWithRetractAccumulator<T> acc, Object value) throws Exception
- Throws:
Exception
-
retract
public void retract(LastValueWithRetractAggFunction.LastValueWithRetractAccumulator<T> acc, Object value, Long order) throws Exception
- Throws:
Exception
-
resetAccumulator
public void resetAccumulator(LastValueWithRetractAggFunction.LastValueWithRetractAccumulator<T> acc)
-
getValue
public T getValue(LastValueWithRetractAggFunction.LastValueWithRetractAccumulator<T> acc)
Description copied from class:AggregateFunction
Called every time when an aggregation result should be materialized. The returned value could be either an early and incomplete result (periodically emitted as data arrives) or the final result of the aggregation.- Specified by:
getValue
in classAggregateFunction<T,LastValueWithRetractAggFunction.LastValueWithRetractAccumulator<T>>
- Parameters:
acc
- the accumulator which contains the current intermediate results- Returns:
- the aggregation result
-
-