[CALCITE-1246] Cleanup duplicate variables in JoinPushThroughJoinRule (Yi Xinglu)
Also, fix typo in comment. Close apache/calcite#234 Project: http://git-wip-us.apache.org/repos/asf/calcite/repo Commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/b6f0e102 Tree: http://git-wip-us.apache.org/repos/asf/calcite/tree/b6f0e102 Diff: http://git-wip-us.apache.org/repos/asf/calcite/diff/b6f0e102 Branch: refs/heads/master Commit: b6f0e1021b8d8e0dc08e6da49391a76cdb6cfb14 Parents: 5a697ee Author: yixinglu <[email protected]> Authored: Thu May 19 21:07:18 2016 +0800 Committer: Julian Hyde <[email protected]> Committed: Sun May 22 12:46:46 2016 -0700 ---------------------------------------------------------------------- .../calcite/rel/rules/JoinPushThroughJoinRule.java | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/calcite/blob/b6f0e102/core/src/main/java/org/apache/calcite/rel/rules/JoinPushThroughJoinRule.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/calcite/rel/rules/JoinPushThroughJoinRule.java b/core/src/main/java/org/apache/calcite/rel/rules/JoinPushThroughJoinRule.java index 402557d..5894130 100644 --- a/core/src/main/java/org/apache/calcite/rel/rules/JoinPushThroughJoinRule.java +++ b/core/src/main/java/org/apache/calcite/rel/rules/JoinPushThroughJoinRule.java @@ -169,11 +169,7 @@ public class JoinPushThroughJoinRule extends RelOptRule { final List<RexNode> newBottomList = new ArrayList<>(); new RexPermuteInputsShuttle(bottomMapping, relA, relC) .visitList(nonIntersecting, newBottomList); - final Mappings.TargetMapping bottomBottomMapping = - Mappings.createShiftMapping( - aCount + bCount, - 0, 0, aCount); - new RexPermuteInputsShuttle(bottomBottomMapping, relA, relC) + new RexPermuteInputsShuttle(bottomMapping, relA, relC) .visitList(bottomNonIntersecting, newBottomList); final RexBuilder rexBuilder = cluster.getRexBuilder(); RexNode newBottomCondition = @@ -259,7 +255,7 @@ public class JoinPushThroughJoinRule extends RelOptRule { } // Split the condition of bottomJoin into a conjunction. Each of the - // parts that use columns from B will need to be pulled up. + // parts that use columns from A will need to be pulled up. final List<RexNode> bottomIntersecting = new ArrayList<>(); final List<RexNode> bottomNonIntersecting = new ArrayList<>(); split( @@ -276,12 +272,7 @@ public class JoinPushThroughJoinRule extends RelOptRule { final List<RexNode> newBottomList = new ArrayList<>(); new RexPermuteInputsShuttle(bottomMapping, relC, relB) .visitList(nonIntersecting, newBottomList); - final Mappings.TargetMapping bottomBottomMapping = - Mappings.createShiftMapping( - aCount + bCount + cCount, - 0, aCount + bCount, cCount, - cCount, aCount, bCount); - new RexPermuteInputsShuttle(bottomBottomMapping, relC, relB) + new RexPermuteInputsShuttle(bottomMapping, relC, relB) .visitList(bottomNonIntersecting, newBottomList); final RexBuilder rexBuilder = cluster.getRexBuilder(); RexNode newBottomCondition =
