rovboyko commented on code in PR #24703:
URL: https://github.com/apache/flink/pull/24703#discussion_r1575883259


##########
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/operators/join/stream/bundle/InputSideHasNoUniqueKeyBundle.java:
##########
@@ -96,15 +96,19 @@ private boolean foldRecord(RowData joinKey, int hashKey, 
RowData record) {
             RowData rec = iterator.previous();
             if ((RowDataUtil.isAccumulateMsg(record) && 
RowDataUtil.isRetractMsg(rec))
                     || (RowDataUtil.isRetractMsg(record) && 
RowDataUtil.isAccumulateMsg(rec))) {
-                iterator.remove();
-                actualSize--;
-                if (list.isEmpty()) {
-                    bundle.get(joinKey).remove(hashKey);
-                    if (bundle.get(joinKey).isEmpty()) {
-                        bundle.remove(joinKey);
+                // here it's necessary to additionally check that record == 
rec because hashKey of
+                // these two records might collide
+                if (record.equals(rec)) {

Review Comment:
   Actually no. Because my first solution requires to copy the record inside 
the `getRecords()` method. This is necessary because if we are storing the 
record as key and `List<RowKind>` as value then we should have `list.size()` of 
records while sending them to processing. Thats's why we should do smth like 
`rowSerializer.copy(record)` for every RowKind in list or use absolutely 
different structure for storing the records and rowKinds. I realized it during 
implementation.



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