Au-Miner opened a new pull request, #28197:
URL: https://github.com/apache/flink/pull/28197

   ## 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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to