Interface AggsHandleFunctionBase
-
- All Superinterfaces:
org.apache.flink.api.common.functions.Function,Serializable
- All Known Subinterfaces:
AggsHandleFunction,TableAggsHandleFunction
public interface AggsHandleFunctionBase extends org.apache.flink.api.common.functions.FunctionThe base class for handling aggregate or table aggregate functions.It is code generated to handle all
AggregateFunctions andTableAggregateFunctions together in an aggregation.It is the entry point for aggregate operators to operate all
AggregateFunctions andTableAggregateFunctions.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaccumulate(org.apache.flink.table.data.RowData input)Accumulates the input values to the accumulators.voidcleanup()Cleanup for the retired accumulators state.voidclose()Tear-down method for this function.org.apache.flink.table.data.RowDatacreateAccumulators()Initializes the accumulators and save them to a accumulators row.org.apache.flink.table.data.RowDatagetAccumulators()Gets the current accumulators (saved in a row) which contains the current aggregated results.voidmerge(org.apache.flink.table.data.RowData accumulators)Merges the other accumulators into current accumulators.voidopen(StateDataViewStore store)Initialization method for the function.voidresetAccumulators()Resets all the accumulators.voidretract(org.apache.flink.table.data.RowData input)Retracts the input values from the accumulators.voidsetAccumulators(org.apache.flink.table.data.RowData accumulators)Set the current accumulators (saved in a row) which contains the current aggregated results.
-
-
-
Method Detail
-
open
void open(StateDataViewStore store) throws Exception
Initialization method for the function. It is called before the actual working methods.- Throws:
Exception
-
accumulate
void accumulate(org.apache.flink.table.data.RowData input) throws ExceptionAccumulates the input values to the accumulators.- Parameters:
input- input values bundled in a row- Throws:
Exception
-
retract
void retract(org.apache.flink.table.data.RowData input) throws ExceptionRetracts the input values from the accumulators.- Parameters:
input- input values bundled in a row- Throws:
Exception
-
merge
void merge(org.apache.flink.table.data.RowData accumulators) throws ExceptionMerges the other accumulators into current accumulators.- Parameters:
accumulators- The other row of accumulators- Throws:
Exception
-
setAccumulators
void setAccumulators(org.apache.flink.table.data.RowData accumulators) throws ExceptionSet the current accumulators (saved in a row) which contains the current aggregated results. In streaming: accumulators are store in the state, we need to restore aggregate buffers from state. In batch: accumulators are store in the hashMap, we need to restore aggregate buffers from hashMap.- Parameters:
accumulators- current accumulators- Throws:
Exception
-
resetAccumulators
void resetAccumulators() throws ExceptionResets all the accumulators.- Throws:
Exception
-
getAccumulators
org.apache.flink.table.data.RowData getAccumulators() throws ExceptionGets the current accumulators (saved in a row) which contains the current aggregated results.- Returns:
- the current accumulators
- Throws:
Exception
-
createAccumulators
org.apache.flink.table.data.RowData createAccumulators() throws ExceptionInitializes the accumulators and save them to a accumulators row.- Returns:
- a row of accumulators which contains the aggregated results
- Throws:
Exception
-
cleanup
void cleanup() throws ExceptionCleanup for the retired accumulators state.- Throws:
Exception
-
-