[FLINK-34380][table] Fix incorrect RowKind in MiniBatch join when INSERT is folded with retract#28671
[FLINK-34380][table] Fix incorrect RowKind in MiniBatch join when INSERT is folded with retract#28671Au-Miner wants to merge 2 commits into
Conversation
…ERT is folded with retract
|
Hi @SteveStevenpoor , thanks for the review. If you have any other questions, please feel free to contact me |
Thanks for your contribution @Au-Miner. The newly added tests look great. Though, I still have a concern. Suppose the first three records in the bundle are +I -U +U. In this case:
I understand that we usually treat +I and +U the same in many situations. However, if the first +U is not a problem for the NoUniqueKey case, why is it important in the other cases? I’m also concerned that this could be confusing for users, because the resulting record’s RowKind would depend on the joined table configuration. That’s my only remaining concern. Please let me know what you think. |
What is the purpose of the change
Fix MiniBatch join output RowKind when an INSERT is folded away with a retract in the same batch. A later UPDATE_AFTER for the same key should be emitted as INSERT if no prior row exists downstream.
Brief change log
InputSideHasUniqueKeyBundle#addRecordandfoldRecordto track insert-and-cleared unique keys and convert the following UPDATE_AFTER to INSERT.JoinKeyContainsUniqueKeyBundle#addRecordandfoldRecordwith the same correction for join keys that contain the unique key.Verifying this change
Updated
BufferBundleTestto assert that+Ifollowed by+Ukeeps the latest record as INSERT. UpdatedStreamingMiniBatchJoinOperatorTestwith MiniBatch join cases for both join-key-contains-unique-key and input-side-has-unique-key paths, asserting that a+I/-U/+Usequence emits INSERT.Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation