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:
[email protected]
With regards,
Apache Git Services