Repository navigation
[BP-2.4][FLINK-41468][table] Keep partition keys in materialized table conversion - #29993
Merged
Merged
Conversation
…sion - Require `PARTITIONED BY` with a partitioned table's partition keys, in the same order, when `CREATE OR ALTER MATERIALIZED TABLE` converts it (unpartitioned tables still take the statement's keys) - Run CREATE's partition validation on conversion, including `partition.fields.#.date-formatter` options - Add `PartitionKeys` tests to `SqlNodeToOperationConvertTableToMaterializedTableTest` - Document the partition-key rule in the conversion's `Partition keys` subsection of `statements.md` (cherry picked from commit 13cc6d0) Generated-by: Claude Code (Claude Opus 5.5)
Timm0
marked this pull request as ready for review
November 17, 2026 16:10
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
Backport of #29968 to
release-2.4. WhenCREATE OR ALTER MATERIALIZED TABLEconverted a partitioned table, the new materialized table could get different partition keys, which made the existing data unreadable. The conversion now requiresPARTITIONED BYwith the table's partition keys in the same order.Brief change log
Cherry-pick of
13cc6d08d96with one conflict:MaterializedTableOperationFactorydoes not exist onrelease-2.4. The partition-key check went intoSqlCreateOrAlterMaterializedTableConverter#handleConvertinstead, with the same error message. The conversion now resolves the new table throughgetResolvedCatalogMaterializedTable, the release-2.4 equivalent ofresolveNewMaterializedTable, so it runsCREATE's partition validation, including thepartition.fields.#.date-formatteroptions.Verifying this change
SqlNodeToOperationConvertTableToMaterializedTableTestand the other materialized table tests inflink-table-plannerpass on this branch.Does 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.5)