gustavodemorais opened a new pull request, #30123:
URL: https://github.com/apache/flink/pull/30123

   ## What is the purpose of the change
   
   `TO_APPEND` reads only INSERT and UPDATE_AFTER rows, but the planner still 
keeps a `ChangelogNormalize` (one row per key in state) below it when the input 
has no upsert key, filters on non-key columns, or reads metadata columns. This 
PR adds an internal `SKIP_RETRACTIONS` argument trait so the planner knows the 
function skips UPDATE_BEFORE and DELETE, and removes the `ChangelogNormalize` 
in those cases. `TO_CHANGELOG` declares it too when `op_mapping` forwards only 
inserts and updates.
   
   ## Brief change log
   
   One commit per optimization, so each can be reverted on its own:
   
   1. Add the internal `SKIP_RETRACTIONS` trait (no plan changes)
   2. FLINK-41674: read upserts without an upsert key (dropped key, `UNION 
ALL`, append-upsert join)
   3. FLINK-41675: forward key-only deletes through keyless Calcs
   4. FLINK-41635: no `ChangelogNormalize` for metadata columns
   5. FLINK-41676: no `ChangelogNormalize` for non-key filters (full deletes 
only)
   6. FLINK-41677: `TO_CHANGELOG` skips retractions for an insert/update-only 
`op_mapping`
   
   Please rebase-merge to keep the commits separate.
   
   Naming: `READ_AS_APPEND` would also work, happy to switch. `ONLY_UPSERTS` 
would be misleading, since an upsert changelog includes DELETE.
   
   ## Verifying this change
   
   Plan tests in `ToAppendTest` and `ToChangelogTest` (incl. guards where 
`ChangelogNormalize` must stay), semantic tests in `ToAppendSemanticTests` that 
compare with projecting/filtering after `TO_APPEND`.
   
   ## 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)`: yes, new internal constant in `StaticArgumentTrait`
     - 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? not applicable
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [x] Yes (please specify the tool below)
   
   Generated-by: Claude Code 2.1.304 (Opus 5.5)
   


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