pyflink.table.udf.TableAggregateFunction#
- class TableAggregateFunction[source]#
Base class for a user-defined table aggregate function. A user-defined table aggregate function maps scalar values of multiple rows to zero, one, or multiple rows (or structured types). If an output record consists of only one field, the structured record can be omitted, and a scalar value can be emitted that will be implicitly wrapped into a row by the runtime.
New in version 1.13.0.
Methods
accumulate
(accumulator, *args)Processes the input values and updates the provided accumulator instance.
close
()Tear-down method for the user code.
create_accumulator
()Creates and initializes the accumulator for this AggregateFunction.
emit_value
(accumulator)Called every time when an aggregation result should be materialized.
get_accumulator_type
()Returns the DataType of the AggregateFunction's accumulator.
get_result_type
()Returns the DataType of the AggregateFunction's result.
is_deterministic
()Returns information about the determinism of the function's results.
merge
(accumulator, accumulators)Merges a group of accumulator instances into one accumulator instance.
open
(function_context)Initialization method for the function.
retract
(accumulator, *args)Retracts the input values from the accumulator instance.The current design assumes the inputs are the values that have been previously accumulated.