[FLINK-40694][table-planner] Fix INSERT INTO with a column list over set-semantic PTFs - #29226
Open
MartijnVisser wants to merge 1 commit into
Open
MartijnVisser wants to merge 1 commit into
MartijnVisser wants to merge 1 commit into
Conversation
…set-semantic PTFs - `PreValidateReWriter` only validates the static partitions and the target column list, it no longer rewrites the source query - The reordering, NULL padding and static partition constants are applied as a projection on the converted plan, like FLINK-40039 did for CTAS/RTAS - Remove `SqlRewriterUtils`, which has no remaining users - An ordinal in `ORDER BY` now refers to the select list of the query, not to the rewritten column order of the sink - A column that is both a static partition and in the target column list now reports a duplicate target column instead of a column count mismatch - Plan output for a partial insert that reorders or pads names every field after the sink column, and `INSERT INTO ... PARTITION ... VALUES` keeps the row in the `Values` node Generated-by: Claude Code (Claude Opus 5)
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
INSERT INTO t (col list) SELECT ... FROM f(TABLE t PARTITION BY k)failed withmust call validate first.PreValidateReWritervalidated the source query once to rewrite it, and the planner then validated the same node again with the same validator.Brief change log
PreValidateReWriteronly validates the static partitions and the target column listSqlRewriterUtils, which has no remaining usersVerifying this change
This change added tests and can be verified as follows:
ToChangelogTestandProcessTableFunctionTestcover the failing statement, four of the new tests fail on masterPartialInsertTestcovers the behaviour change the commit and the Jira release note recordDoes 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 (Claude Opus 5)