Skip to content

[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
apache:masterfrom
Au-Miner:FLINK-36735
Open

[FLINK-36735][table] Include updated columns when sink declares partial required columns for row-level update#28197
Au-Miner wants to merge 1 commit into
apache:masterfrom
Au-Miner:FLINK-36735

Conversation

@Au-Miner
Copy link
Copy Markdown
Contributor

What is the purpose of the change

Fix SupportsRowLevelUpdate so that when a sink returns RowLevelUpdateInfo#requiredColumns containing 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

  • In DynamicSinkUtils#convertToRowLevelUpdate, merge the SET-clause updatedColumns into the sink-declared requiredColumns (de-duplicated, required first) before building the projection and the RowLevelUpdateSpec physical column indices.
  • Add helper DynamicSinkUtils#mergeRequiredAndUpdatedColumns and thread updatedColumns from convertUpdate into convertToRowLevelUpdate.
  • Align TestUpdateDeleteTableFactory.SupportsRowLevelUpdateSink#applyRowLevelUpdate so its tracked requiredColumnIndices reflect 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, and UpdateTableITCase#testUpdateWithRequiredColumnsExcludingUpdatedColumns (batch IT) which asserts the table's non-required column is correctly updated end-to-end. Both run under UPDATED_ROWS and ALL_ROWS modes.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented? no

@flinkbot
Copy link
Copy Markdown
Collaborator

flinkbot commented May 19, 2026

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants