You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2020/06/04 12:48:07 UTC

[GitHub] [calcite] hsyuan commented on a change in pull request #2002: [CALCITE-4042] JoinCommuteRule must not match SEMI / ANTI join

hsyuan commented on a change in pull request #2002:
URL: https://github.com/apache/calcite/pull/2002#discussion_r435225707



##########
File path: core/src/main/java/org/apache/calcite/rel/rules/JoinCommuteRule.java
##########
@@ -145,6 +145,12 @@ public static RelNode swap(Join join, boolean swapOuterJoins,
         .build();
   }
 
+  public boolean matches(RelOptRuleCall call) {
+    Join join = call.rel(0);
+    // SEMI and ANTI join cannot be swapped.
+    return join.getJoinType().projectsRight();
+  }

Review comment:
       LOL. 😝
   I remembered I created that JIRA but not immediately create a pull request, because I had to come up with a test case.
   The code change looks good to me, but I think we'd better add a test case. :)




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

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