[FLINK-36735][table] Include updated columns when sink declares partial required columns for row-level update#28197
Open
Au-Miner wants to merge 1 commit into
Open
[FLINK-36735][table] Include updated columns when sink declares partial required columns for row-level update#28197Au-Miner wants to merge 1 commit into
Au-Miner wants to merge 1 commit into
Conversation
…al required columns for row-level update
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
Fix
SupportsRowLevelUpdateso that when a sink returnsRowLevelUpdateInfo#requiredColumnscontaining only a subset of columns (e.g., primary keys), the rows it receives still carry the new values for the columns being updated. Previously the planner projected only the sink-declared required columns, dropping the SET expressions and leaving the sink unable to perform the update.Brief change log
DynamicSinkUtils#convertToRowLevelUpdate, merge the SET-clauseupdatedColumnsinto the sink-declaredrequiredColumns(de-duplicated, required first) before building the projection and theRowLevelUpdateSpecphysical column indices.DynamicSinkUtils#mergeRequiredAndUpdatedColumnsand threadupdatedColumnsfromconvertUpdateintoconvertToRowLevelUpdate.TestUpdateDeleteTableFactory.SupportsRowLevelUpdateSink#applyRowLevelUpdateso its trackedrequiredColumnIndicesreflect the merged column set the sink actually receives at runtime.Verifying this change
Added
RowLevelUpdateTest#testUpdateWithRequiredColumnsExcludingUpdatedColumns(plan test) which asserts the projection now contains both the sink-declared required column and the updated column, andUpdateTableITCase#testUpdateWithRequiredColumnsExcludingUpdatedColumns(batch IT) which asserts the table's non-required column is correctly updated end-to-end. Both run underUPDATED_ROWSandALL_ROWSmodes.Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation