[FLINK-39548][table-planner] Fix projected primary key indices for ch…#28042
Open
ljw-hit wants to merge 2 commits intoapache:masterfrom
Open
[FLINK-39548][table-planner] Fix projected primary key indices for ch…#28042ljw-hit wants to merge 2 commits intoapache:masterfrom
ljw-hit wants to merge 2 commits intoapache:masterfrom
Conversation
…angelog sources This fixes CommonExecTableSourceScan to derive primary key indices from the projected output type instead of the physical row type. Queries that reorder projected columns for changelog sources now keep the source partitioner aligned with the declared primary key fields. The change also adds a regression test that validates the partitioner extracts keys from the projected row in the expected primary key order. Generated-by: TraeCli (GPT-5.4)
Collaborator
Contributor
|
@ljw-hit Can you update the PR description to follow the guidelines and add more details about the change. |
The helper became unused after deriving PK indices from the projected output type.
Author
|
Thanks for spotting this. getPhysicalRowType(ResolvedSchema) became unused after switching PK index derivation to the projected output type, and it has been removed in commit 7367645. |
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
Fix primary key index derivation for changelog sources when the scan output is projected.
CommonExecTableSourceScanpreviously derived primary key field indices from the physical row type, which can differ from the projected output type (e.g., after reordering / projection). This could misalign the partitioner/key selector with the declared primary key fields. This PR derives indices from the projected output type instead.Brief change log
Verifying this change
This change added tests and can be verified as follows:
./mvnw -pl flink-table/flink-table-planner -Dtest=TransformationsTest testDoes 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: TraeCli (GPT-5.4)