gustavodemorais commented on code in PR #26702:
URL: https://github.com/apache/flink/pull/26702#discussion_r2157531634


##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/rules/logical/JoinToMultiJoinRule.java:
##########
@@ -546,12 +557,140 @@ private boolean canCombine(
             } else {
                 return false;
             }
-            return true;
+            return haveCommonJoinKey(origJoin, join);
         } else {
             return false;
         }
     }
 
+    /**
+     * Checks if original Join and child multi-join have common join keys.
+     *
+     * @param origJoin original Join
+     * @param otherJoin child MultiJoin
+     * @return true if original Join and child multi-join have at least one 
common JoinKey
+     */
+    private boolean haveCommonJoinKey(Join origJoin, MultiJoin otherJoin) {

Review Comment:
   I think both would be work since you could also read the the "joins" _have_ 
a common join key 🤷‍♂️



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