ehds commented on code in PR #5301:
URL: https://github.com/apache/calcite/pull/5301#discussion_r4177107608


##########
core/src/main/java/org/apache/calcite/rel/rules/MultiJoinOptimizeBushyRule.java:
##########
@@ -104,16 +104,11 @@ public 
MultiJoinOptimizeBushyRule(RelFactories.JoinFactory joinFactory,
     final RelMetadataQuery mq = call.getMetadataQuery();
 
     final LoptMultiJoin multiJoin = new LoptMultiJoin(multiJoinRel);
-    for (int i = 0; i < multiJoin.getNumJoinFactors(); i++) {
-      ImmutableBitSet outerJoinFactors = multiJoin.getOuterJoinFactors(i);
-      if (outerJoinFactors == null) {
-        continue;
-      }
-      if (!outerJoinFactors.isEmpty()) {
-        // Refuse to apply this rule to a multijoin with outer joins,
-        // since this rule cannot handle outer joins.
-        return;
-      }
+
+    if (multiJoinRel.isFullOuterJoin() || multiJoinRel.containsOuter()) {
+      // Refuse to apply this rule to a multijoin with outer joins,

Review Comment:
   Yes. This rule rebuilds all join factors from `LoptMultiJoin` as `INNER` 
joins, so it cannot preserve outer-join semantics. 
   The issue was frist reported by 
https://issues.apache.org/jira/browse/CALCITE-5289



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