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


##########
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:
   This is indeed a solution, but I think the one you mentioned in 
[issue](https://issues.apache.org/jira/browse/FLINK-35184?page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel&focusedCommentId=17839540#comment-17839540)
 is better.  Current implementation occupies more space compared to the 
solution mentioned above. WYDT?



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to