You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by sm...@apache.org on 2015/12/08 01:22:57 UTC

[1/2] drill git commit: DRILL-4165 Fix a bug in counting records in outgoing batch.

Repository: drill
Updated Branches:
  refs/heads/master d855906b9 -> fe3da5ce9


DRILL-4165 Fix a bug in counting records in outgoing batch.


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/0ced1986
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/0ced1986
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/0ced1986

Branch: refs/heads/master
Commit: 0ced1986f281f830c695ede94138a461431ed8f4
Parents: d855906
Author: Amit Hadke <am...@gmail.com>
Authored: Mon Dec 7 14:13:55 2015 -0800
Committer: Amit Hadke <am...@gmail.com>
Committed: Mon Dec 7 14:13:55 2015 -0800

----------------------------------------------------------------------
 .../drill/exec/physical/impl/join/JoinStatus.java       |  4 ++--
 .../drill/exec/physical/impl/join/JoinTemplate.java     |  8 ++++++--
 .../exec/physical/impl/join/TestMergeJoinAdvanced.java  | 12 ++++++++++++
 3 files changed, 20 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/0ced1986/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinStatus.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinStatus.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinStatus.java
index f7154f8..e968236 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinStatus.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinStatus.java
@@ -99,7 +99,7 @@ public final class JoinStatus {
   }
 
   public final boolean isOutgoingBatchFull() {
-    return outputPosition == OUTPUT_BATCH_SIZE;
+    return outputPosition >= OUTPUT_BATCH_SIZE;
   }
 
   public final void incOutputPos() {
@@ -160,4 +160,4 @@ public final class JoinStatus {
     return getLeftStatus() == outcome || getRightStatus() == outcome;
   }
 
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/drill/blob/0ced1986/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinTemplate.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinTemplate.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinTemplate.java
index ed900db..40c47b3 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinTemplate.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinTemplate.java
@@ -83,6 +83,12 @@ public abstract class JoinTemplate implements JoinWorker {
             doCopyRight(status.right.getCurrentPosition(), status.getOutPosition());
             status.incOutputPos();
           }
+          if (status.isOutgoingBatchFull()) {
+            // Leave iterators at their current positions and markers.
+            // Don't mark on all subsequent doJoin iterations.
+            status.disableMarking();
+            return true;
+          }
           // Move to next position in right iterator.
           status.right.next();
           while (!status.right.finished()) {
@@ -91,8 +97,6 @@ public abstract class JoinTemplate implements JoinWorker {
               doCopyRight(status.right.getCurrentPosition(), status.getOutPosition());
               status.incOutputPos();
               if (status.isOutgoingBatchFull()) {
-                // Leave iterators at their current positions and markers.
-                // Don't mark on all subsequent doJoin iterations.
                 status.disableMarking();
                 return true;
               }

http://git-wip-us.apache.org/repos/asf/drill/blob/0ced1986/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/join/TestMergeJoinAdvanced.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/join/TestMergeJoinAdvanced.java b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/join/TestMergeJoinAdvanced.java
index 87058f2..05776d3 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/join/TestMergeJoinAdvanced.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/join/TestMergeJoinAdvanced.java
@@ -202,4 +202,16 @@ public class TestMergeJoinAdvanced extends BaseTestQuery {
     final long left = r.nextInt(10001) + 1l;
     testMultipleBatchJoin(left, right, "right", left * right + 3l);
   }
+
+  @Test
+  public void testDrill4165() throws Exception {
+    final String query1 = "select count(*) cnt from cp.`tpch/lineitem.parquet` l1, cp.`tpch/lineitem.parquet` l2 where l1.l_partkey = l2.l_partkey and l1.l_suppkey < 30 and l2.l_suppkey < 30";
+    testBuilder()
+      .sqlQuery(query1)
+      .optionSettingQueriesForTestQuery("alter session set `planner.enable_hashjoin` = false")
+      .unOrdered()
+      .baselineColumns("cnt")
+      .baselineValues(202452l)
+      .go();
+  }
 }


[2/2] drill git commit: DRILL-4165 remove redundant call to setting hash join session option.

Posted by sm...@apache.org.
DRILL-4165 remove redundant call to setting hash join session option.


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/fe3da5ce
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/fe3da5ce
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/fe3da5ce

Branch: refs/heads/master
Commit: fe3da5ce96e06758618d5dd4d6255fdfffc9c00a
Parents: 0ced198
Author: Amit Hadke <am...@gmail.com>
Authored: Mon Dec 7 14:41:34 2015 -0800
Committer: Amit Hadke <am...@gmail.com>
Committed: Mon Dec 7 14:41:34 2015 -0800

----------------------------------------------------------------------
 .../apache/drill/exec/physical/impl/join/TestMergeJoinAdvanced.java | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/fe3da5ce/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/join/TestMergeJoinAdvanced.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/join/TestMergeJoinAdvanced.java b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/join/TestMergeJoinAdvanced.java
index 05776d3..ac6ac89 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/join/TestMergeJoinAdvanced.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/join/TestMergeJoinAdvanced.java
@@ -208,7 +208,6 @@ public class TestMergeJoinAdvanced extends BaseTestQuery {
     final String query1 = "select count(*) cnt from cp.`tpch/lineitem.parquet` l1, cp.`tpch/lineitem.parquet` l2 where l1.l_partkey = l2.l_partkey and l1.l_suppkey < 30 and l2.l_suppkey < 30";
     testBuilder()
       .sqlQuery(query1)
-      .optionSettingQueriesForTestQuery("alter session set `planner.enable_hashjoin` = false")
       .unOrdered()
       .baselineColumns("cnt")
       .baselineValues(202452l)