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 2021/05/26 13:33:39 UTC

[GitHub] [calcite] zabetak commented on a change in pull request #2418: [CALCITE-4621] SemiJoinRule throws AssertionError on ANTI join

zabetak commented on a change in pull request #2418:
URL: https://github.com/apache/calcite/pull/2418#discussion_r639730115



##########
File path: core/src/main/java/org/apache/calcite/rel/rules/SemiJoinRule.java
##########
@@ -45,8 +46,9 @@
 public abstract class SemiJoinRule
     extends RelRule<SemiJoinRule.Config>
     implements TransformationRule {
-  private static boolean notGenerateNullsOnLeft(Join join) {
-    return !join.getJoinType().generatesNullsOnLeft();
+  private static boolean isJoinTypeSupported(Join join) {
+    final JoinRelType type = join.getJoinType();
+    return type != JoinRelType.RIGHT && type != JoinRelType.FULL && type != JoinRelType.ANTI;

Review comment:
       The code could be slightly more readable (given the current name of the method) if you formulated the condition using `==` instead of `!=` operator. The equivalent of the current code would be:
   `return type == JoinRelType.INNER || type == JoinRelType.LEFT || type == JoinRelType.SEMI`
   
   Moreover, I am not sure if it is intended that you consider `SEMI` as supported join type. I was thinking that it doesn't make sense to use the rule if the join is already `SEMI` join. 




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