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

   ## What is the purpose of the change
   
   A subset of FLINK-40681, raised in this PR 
https://github.com/apache/flink/pull/29204.
   
   When the planner drops UPDATE_BEFORE on an outer join input, an
   UPDATE_AFTER or repeated INSERT can replace a stored record with the same 
unique key.
   `StreamingJoinOperator` counted it as a new match of the outer-side record, 
so after the
   record was deleted the count never reached 0 and the null-padded row was 
never emitted again.
   
   ## Brief change log
   
   - An accumulate message only increments the other side's association count 
if it is an
     additional match, or if the other-side record has no match yet.
   - If the join key contains the unique key, this needs no state access. If 
the input side has
     another unique key, it costs one `contains` lookup, only when the other 
side is outer.
   - `JoinRecordStateView#hasRecord` looks up a record with the same unique key.
   
   ## Verifying this change
   
   - Harness tests in `StreamingJoinOperatorTest` for left, right and full 
outer joins across the
     unique-key specs, plus a direct test of `hasRecord`.
   - `testLeftOuterJoinWithStateRetentionDisabled` now expects the restored 
null padding.
   - `AsyncStateStreamingJoinOperator`, mini-batch and semi/anti joins are not 
part of this change.
   
   ## 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): yes, one extra 
state lookup per
     accumulate message only for outer joins whose input unique key is not 
contained in the join key
   - Anything that affects deployment or recovery: 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 (Claude 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