drill git commit: DRILL-4927: Add support for Null Equality Joins
Repository: drill Updated Branches: refs/heads/master 46b424cbd -> a29f1e292 DRILL-4927: Add support for Null Equality Joins These changes are a subset of the original pull request from DRILL-4539 (PR-462). - Added changes to support Null Equality Joins; - Created tests for it. close apache/drill#603 Project: http://git-wip-us.apache.org/repos/asf/drill/repo Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/a29f1e29 Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/a29f1e29 Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/a29f1e29 Branch: refs/heads/master Commit: a29f1e292fc8068ce13d336ba93abcc64f31da26 Parents: 46b424c Author: Roman KulykAuthored: Tue Oct 4 13:58:13 2016 + Committer: Aman Sinha Committed: Tue Oct 11 23:02:26 2016 -0700 -- .../exec/physical/impl/join/JoinUtils.java | 37 - .../exec/planner/common/DrillJoinRelBase.java | 9 ++- .../planner/logical/DrillFilterJoinRules.java | 3 +- .../exec/planner/logical/DrillJoinRel.java | 2 +- .../exec/planner/logical/DrillJoinRule.java | 53 ++--- .../exec/planner/physical/HashJoinPrel.java | 2 +- .../exec/planner/physical/JoinPruleBase.java| 5 +- .../exec/planner/physical/MergeJoinPrel.java| 2 +- .../planner/physical/NestedLoopJoinPrel.java| 2 +- .../planner/physical/NestedLoopJoinPrule.java | 5 +- .../planner/sql/handlers/DefaultSqlHandler.java | 6 +- .../java/org/apache/drill/TestJoinNullable.java | 79 pom.xml | 2 +- 13 files changed, 149 insertions(+), 58 deletions(-) -- http://git-wip-us.apache.org/repos/asf/drill/blob/a29f1e29/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinUtils.java -- diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinUtils.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinUtils.java index 61640bc..be363d2 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinUtils.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinUtils.java @@ -86,17 +86,19 @@ public class JoinUtils { * Check if the given RelNode contains any Cartesian join. * Return true if find one. Otherwise, return false. * - * @param relNode the RelNode to be inspected. - * @param leftKeys a list used for the left input into the join which has - * equi-join keys. It can be empty or not (but not null), - * this method will clear this list before using it. - * @param rightKeys a list used for the right input into the join which has - * equi-join keys. It can be empty or not (but not null), - * this method will clear this list before using it. - * @return Return true if the given relNode contains Cartesian join. - * Otherwise, return false + * @param relNode the RelNode to be inspected. + * @param leftKeysa list used for the left input into the join which has + *equi-join keys. It can be empty or not (but not null), + *this method will clear this list before using it. + * @param rightKeys a list used for the right input into the join which has + *equi-join keys. It can be empty or not (but not null), + *this method will clear this list before using it. + * @param filterNulls The join key positions for which null values will not + *match. + * @returnReturn true if the given relNode contains Cartesian join. + *Otherwise, return false */ - public static boolean checkCartesianJoin(RelNode relNode, List leftKeys, List rightKeys) { + public static boolean checkCartesianJoin(RelNode relNode, List leftKeys, List rightKeys, List filterNulls) { if (relNode instanceof Join) { leftKeys.clear(); rightKeys.clear(); @@ -105,20 +107,20 @@ public class JoinUtils { RelNode left = joinRel.getLeft(); RelNode right = joinRel.getRight(); - RexNode remaining = RelOptUtil.splitJoinCondition(left, right, joinRel.getCondition(), leftKeys, rightKeys); - if(joinRel.getJoinType() == JoinRelType.INNER) { -if(leftKeys.isEmpty() || rightKeys.isEmpty()) { + RexNode remaining = RelOptUtil.splitJoinCondition(left, right, joinRel.getCondition(), leftKeys, rightKeys, filterNulls); + if (joinRel.getJoinType() == JoinRelType.INNER) { +if (leftKeys.isEmpty() || rightKeys.isEmpty()) { return true; }
drill git commit: DRILL-4927: Add support for Null Equality Joins
Repository: drill Updated Branches: refs/heads/merge_09_19_16 [created] a29f1e292 DRILL-4927: Add support for Null Equality Joins These changes are a subset of the original pull request from DRILL-4539 (PR-462). - Added changes to support Null Equality Joins; - Created tests for it. close apache/drill#603 Project: http://git-wip-us.apache.org/repos/asf/drill/repo Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/a29f1e29 Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/a29f1e29 Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/a29f1e29 Branch: refs/heads/merge_09_19_16 Commit: a29f1e292fc8068ce13d336ba93abcc64f31da26 Parents: 46b424c Author: Roman KulykAuthored: Tue Oct 4 13:58:13 2016 + Committer: Aman Sinha Committed: Tue Oct 11 23:02:26 2016 -0700 -- .../exec/physical/impl/join/JoinUtils.java | 37 - .../exec/planner/common/DrillJoinRelBase.java | 9 ++- .../planner/logical/DrillFilterJoinRules.java | 3 +- .../exec/planner/logical/DrillJoinRel.java | 2 +- .../exec/planner/logical/DrillJoinRule.java | 53 ++--- .../exec/planner/physical/HashJoinPrel.java | 2 +- .../exec/planner/physical/JoinPruleBase.java| 5 +- .../exec/planner/physical/MergeJoinPrel.java| 2 +- .../planner/physical/NestedLoopJoinPrel.java| 2 +- .../planner/physical/NestedLoopJoinPrule.java | 5 +- .../planner/sql/handlers/DefaultSqlHandler.java | 6 +- .../java/org/apache/drill/TestJoinNullable.java | 79 pom.xml | 2 +- 13 files changed, 149 insertions(+), 58 deletions(-) -- http://git-wip-us.apache.org/repos/asf/drill/blob/a29f1e29/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinUtils.java -- diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinUtils.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinUtils.java index 61640bc..be363d2 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinUtils.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinUtils.java @@ -86,17 +86,19 @@ public class JoinUtils { * Check if the given RelNode contains any Cartesian join. * Return true if find one. Otherwise, return false. * - * @param relNode the RelNode to be inspected. - * @param leftKeys a list used for the left input into the join which has - * equi-join keys. It can be empty or not (but not null), - * this method will clear this list before using it. - * @param rightKeys a list used for the right input into the join which has - * equi-join keys. It can be empty or not (but not null), - * this method will clear this list before using it. - * @return Return true if the given relNode contains Cartesian join. - * Otherwise, return false + * @param relNode the RelNode to be inspected. + * @param leftKeysa list used for the left input into the join which has + *equi-join keys. It can be empty or not (but not null), + *this method will clear this list before using it. + * @param rightKeys a list used for the right input into the join which has + *equi-join keys. It can be empty or not (but not null), + *this method will clear this list before using it. + * @param filterNulls The join key positions for which null values will not + *match. + * @returnReturn true if the given relNode contains Cartesian join. + *Otherwise, return false */ - public static boolean checkCartesianJoin(RelNode relNode, List leftKeys, List rightKeys) { + public static boolean checkCartesianJoin(RelNode relNode, List leftKeys, List rightKeys, List filterNulls) { if (relNode instanceof Join) { leftKeys.clear(); rightKeys.clear(); @@ -105,20 +107,20 @@ public class JoinUtils { RelNode left = joinRel.getLeft(); RelNode right = joinRel.getRight(); - RexNode remaining = RelOptUtil.splitJoinCondition(left, right, joinRel.getCondition(), leftKeys, rightKeys); - if(joinRel.getJoinType() == JoinRelType.INNER) { -if(leftKeys.isEmpty() || rightKeys.isEmpty()) { + RexNode remaining = RelOptUtil.splitJoinCondition(left, right, joinRel.getCondition(), leftKeys, rightKeys, filterNulls); + if (joinRel.getJoinType() == JoinRelType.INNER) { +if (leftKeys.isEmpty() || rightKeys.isEmpty()) { return