[FLINK-40271][table] Fix SQL serialization of Table API group window properties - #28886
Open
Timm0 wants to merge 1 commit into
Open
[FLINK-40271][table] Fix SQL serialization of Table API group window properties#28886Timm0 wants to merge 1 commit into
Timm0 wants to merge 1 commit into
Conversation
- Serialize window properties to the windowing-TVF output columns `window_start`, `window_end` and `window_time` instead of emitting the group window alias, which produced unparseable SQL - Add `window_time` to the `GROUP BY` when a `rowtime()`/`proctime()` property is projected - Reject a `proctime()` property on an event-time group window with a `TableException` - Add `TableTestProgram#getRunTableApiTestStep` - Add rowtime and proctime serialization test programs, plus semantic coverage of the generated SQL for the rowtime case
Timm0
marked this pull request as ready for review
August 3, 2026 09:55
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
Table API group-window properties —
$("w").start(),$("w").end(),$("w").rowtime()and$("w").proctime()— were not translated to the corresponding windowing-TVF output columns when aWindowAggregateQueryOperationis serialized back to SQL. The group window alias was emitted as if it were a column reference, so the generated statement failed to validate withColumn 'w' not found in any table. This change maps each property onto the TVF'swindow_start/window_end/window_timecolumns and addswindow_timeto theGROUP BYwhen it is projected, so the serialized SQL parses and produces the same results as the Table API program it came from.Brief change log
window_start,window_endandwindow_timeinstead of emitting the group window alias, which produced unparseable SQLwindow_timeto theGROUP BYwhen arowtime()/proctime()property is projectedproctime()property on an event-time group window with aTableExceptionTableTestProgram#getRunTableApiTestStepVerifying this change
QueryOperationSqlSerializationTestandQueryOperationSqlSemanticTestDoes this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code Opus 5 (1M context)