...
For the difference in features between Group Window Aggregation and Window TVF Aggregation, please refer to the appendix chapter[2]. Compared to Group Window Aggergation, Window TVF Aggergation has several advantages, such as two-stage optimization, support for standard GROUPING SET
syntax, and so on. However, it needs to supplement and enrich the following features.
...
This flip aims to continue the unfinished work in FLIP-145[32], which is to fully enable the capabilities of Window TVF Aggregation and officially deprecate the legacy syntax Group Window Aggregation, to prepare for the removal of the legacy one in Flink 2.0. Support for new features such as Window Join and Window TopN involved in Flip-145 will be followed up in separate tasks.
...
In the SQL API, we only need to add support for the syntax of Session Window TVF. Although it is not yet implemented, FLIP-145[32] has provided the standard syntax about Session Window TVF. The syntax is as follows:
...
Table Parser
Based on Calcite-4865[43], we can already use Session Window TVF syntax as described in FLIP-145. However, in Calcite, a Table Function contains PARTITION BY
or ORDER BY
will be converted into a PTF (Polymorphic Table function). PTF has some key features that need to be set as follows. (copied from Calcite documentation[54])
- ROW semantics or SET semantics
...
The base capability of the WindowAggregate operator to support consuming CDC stream has been implemented(AggCombiner#combine[65]). By modifying the logic about inferring ModifyKind/Update Kind, inferring Upsert Key, code generation and etc, we can ensure that the WindowAggregate operator fulfills this feature. All that remains is to conduct correctness tests for various scenarios.
...
[1] https://nightlies.apache.org/flink/flink-docs-master/docs/dev/table/sql/queries/window-agg/
[2] https://cwiki.apache.org/confluence/display/FLINK/FLIP-392%3A+Deprecate+the+Legacy+Group+Window+Aggregation#appendix[3] https://cwiki.apache.org/confluence/display/FLINK/FLIP-145%3A+Support+SQL+windowing+table-valued+function#FLIP145:SupportSQLwindowingtablevaluedfunction-SessionWindows
[43] https://issues.apache.org/jira/browse/CALCITE-4865
[54] https://calcite.apache.org/docs/reference.html#table-functions
...