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 2019/07/02 09:27:15 UTC

[GitHub] [calcite] chunweilei commented on a change in pull request #1247: [CALCITE-3089] Deprecate EquiJoin

chunweilei commented on a change in pull request #1247: [CALCITE-3089] Deprecate EquiJoin
URL: https://github.com/apache/calcite/pull/1247#discussion_r299385352
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableJoinRule.java
 ##########
 @@ -58,35 +58,26 @@
     final RelNode right = newInputs.get(1);
     final JoinInfo info = JoinInfo.of(left, right, join.getCondition());
     if (!info.isEqui() && join.getJoinType() != JoinRelType.INNER) {
-      // EnumerableJoinRel only supports equi-join. We can put a filter on top
+      // EnumerableHashJoin only supports equi-join. We can put a filter on top
       // if it is an inner join.
-      try {
-        return EnumerableNestedLoopJoin.create(
-            left,
-            right,
-            join.getCondition(),
-            join.getVariablesSet(),
-            join.getJoinType());
-      } catch (InvalidRelException e) {
-        EnumerableRules.LOGGER.debug(e.toString());
-        return null;
-      }
+      return EnumerableNestedLoopJoin.create(
+          left,
+          right,
+          join.getCondition(),
+          join.getVariablesSet(),
+          join.getJoinType());
     } else {
       RelNode newRel;
-      try {
-        newRel = EnumerableHashJoin.create(
-            left,
-            right,
-            info.getEquiCondition(left, right, cluster.getRexBuilder()),
-            join.getVariablesSet(),
-            join.getJoinType());
-      } catch (InvalidRelException e) {
-        EnumerableRules.LOGGER.debug(e.toString());
-        return null;
-      }
-      if (!info.isEqui()) {
+      newRel = EnumerableHashJoin.create(
+          left,
+          right,
+          info.getEquiCondition(left, right, cluster.getRexBuilder()),
+          join.getVariablesSet(),
+          join.getJoinType());
+      RexNode nonEqui = info.getRemaining(cluster.getRexBuilder());
+      if (!nonEqui.isAlwaysTrue()) {
 
 Review comment:
   This check is necessary. But I prefer use` !info.isEqui()` since it is more clear?.

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


With regards,
Apache Git Services