Interface NamespaceAggsHandleFunctionBase<N>
- Type Parameters:
N- type of namespace
- All Superinterfaces:
org.apache.flink.api.common.functions.Function,Serializable
- All Known Subinterfaces:
NamespaceAggsHandleFunction<N>,NamespaceTableAggsHandleFunction<N>
public interface NamespaceAggsHandleFunctionBase<N>
extends org.apache.flink.api.common.functions.Function
The base class for handling aggregate or table aggregate functions.
The differences between NamespaceAggsHandleFunctionBase and AggsHandleFunctionBase is that the NamespaceAggsHandleFunctionBase has namespace.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaccumulate(org.apache.flink.table.data.RowData inputRow) Accumulates the input values to the accumulators.voidCleanup for the retired accumulators state.voidclose()Tear-down method for this function.org.apache.flink.table.data.RowDataInitializes the accumulators and save them to a accumulators row.org.apache.flink.table.data.RowDataGets the current accumulators (saved in a row) which contains the current aggregated results.voidMerges the other accumulators into current accumulators.voidopen(StateDataViewStore store) Initialization method for the function.voidretract(org.apache.flink.table.data.RowData inputRow) Retracts the input values from the accumulators.voidsetAccumulators(N namespace, org.apache.flink.table.data.RowData accumulators) Set the current accumulators (saved in a row) which contains the current aggregated results.
-
Method Details
-
open
Initialization method for the function. It is called before the actual working methods.- Throws:
Exception
-
setAccumulators
void setAccumulators(N namespace, org.apache.flink.table.data.RowData accumulators) throws Exception Set the current accumulators (saved in a row) which contains the current aggregated results.- Parameters:
accumulators- current accumulators- Throws:
Exception
-
accumulate
Accumulates the input values to the accumulators.- Parameters:
inputRow- input values bundled in a row- Throws:
Exception
-
retract
Retracts the input values from the accumulators.- Parameters:
inputRow- input values bundled in a row- Throws:
Exception
-
merge
Merges the other accumulators into current accumulators.- Parameters:
otherAcc- The other row of accumulators- Throws:
Exception
-
createAccumulators
Initializes the accumulators and save them to a accumulators row.- Returns:
- a row of accumulators which contains the aggregated results
- Throws:
Exception
-
getAccumulators
Gets the current accumulators (saved in a row) which contains the current aggregated results.- Returns:
- the current accumulators
- Throws:
Exception
-
cleanup
Cleanup for the retired accumulators state.- Throws:
Exception
-
close
Tear-down method for this function. It can be used for clean up work. By default, this method does nothing.- Throws:
Exception
-