drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject drill git commit: DRILL-2087: Fix an incorrect join plan by ensure either both sides are distributed, or none of them is distributed.
Date Thu, 12 Feb 2015 16:50:12 GMT
Repository: drill
Updated Branches:
  refs/heads/master 066b6dbc3 -> de89f36d9


DRILL-2087: Fix an incorrect join plan by ensure either both sides are distributed, or none
of them is distributed.

Add unit testcase.


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

Branch: refs/heads/master
Commit: de89f36d9e90ea40f1566b8eb506fb9d656a0d0d
Parents: 066b6db
Author: Jinfeng Ni <jni@maprtech.com>
Authored: Wed Jan 28 10:12:30 2015 -0800
Committer: Jinfeng Ni <jni@apache.org>
Committed: Thu Feb 12 08:49:00 2015 -0800

----------------------------------------------------------------------
 .../visitor/ExcessiveExchangeIdentifier.java      |   9 +++++++++
 .../java/org/apache/drill/TestExampleQueries.java |  17 +++++++++++++++++
 .../test/resources/tpchmulti/nation/01.parquet    | Bin 0 -> 1376 bytes
 .../test/resources/tpchmulti/nation/02.parquet    | Bin 0 -> 1400 bytes
 .../test/resources/tpchmulti/nation/03.parquet    | Bin 0 -> 1279 bytes
 .../test/resources/tpchmulti/region/01.parquet    | Bin 0 -> 564 bytes
 .../test/resources/tpchmulti/region/02.parquet    | Bin 0 -> 491 bytes
 .../test/resources/tpchmulti/region/03.parquet    | Bin 0 -> 506 bytes
 8 files changed, 26 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/de89f36d/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/visitor/ExcessiveExchangeIdentifier.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/visitor/ExcessiveExchangeIdentifier.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/visitor/ExcessiveExchangeIdentifier.java
index 82409d8..a237014 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/visitor/ExcessiveExchangeIdentifier.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/visitor/ExcessiveExchangeIdentifier.java
@@ -72,6 +72,15 @@ public class ExcessiveExchangeIdentifier extends BasePrelVisitor<Prel,
Excessive
   public Prel visitPrel(Prel prel, MajorFragmentStat s) throws RuntimeException {
     List<RelNode> children = Lists.newArrayList();
     s.add(prel);
+
+    // Add all children to MajorFragmentStat, before we visit each child.
+    // Since MajorFramentStat keeps track of maxRows of Prels in MajorFrag, it's fine to
add prel multiple times.
+    // Doing this will ensure MajorFragmentStat is same when visit each individual child,
in order to make
+    // consistent decision.
+    for (Prel p : prel) {
+      s.add(p);
+    }
+
     for(Prel p : prel) {
       children.add(p.accept(this, s));
     }

http://git-wip-us.apache.org/repos/asf/drill/blob/de89f36d/exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java b/exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java
index dffa0a6..f9ef8ad 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java
@@ -20,6 +20,7 @@ package org.apache.drill;
 import static org.junit.Assert.assertEquals;
 
 import org.apache.drill.common.util.FileUtils;
+import org.apache.drill.common.util.TestTools;
 import org.junit.Ignore;
 import org.junit.Test;
 
@@ -549,4 +550,20 @@ public class TestExampleQueries extends BaseTestQuery{
     .build().run();
   }
 
+  @Test
+  public void testExchangeRemoveForJoinPlan() throws Exception {
+    final String WORKING_PATH = TestTools.getWorkingPath();
+    final String TEST_RES_PATH = WORKING_PATH + "/src/test/resources";
+
+    String sql = String.format("select t2.n_nationkey from dfs_test.`%s/tpchmulti/region`
t1 join dfs_test.`%s/tpchmulti/nation` t2 on t2.n_regionkey = t1.r_regionkey", TEST_RES_PATH,
TEST_RES_PATH);
+
+    testBuilder()
+        .unOrdered()
+        .optionSettingQueriesForTestQuery("alter session set `planner.slice_target` = 10;
alter session set `planner.join.row_count_estimate_factor` = 0.1")  // Enforce exchange will
be inserted.
+        .sqlQuery(sql)
+        .optionSettingQueriesForBaseline("alter session set `planner.slice_target` = 100000;
alter session set `planner.join.row_count_estimate_factor` = 1.0") // Use default option setting.
+        .sqlBaselineQuery(sql)
+        .build().run();
+
+  }
 }

http://git-wip-us.apache.org/repos/asf/drill/blob/de89f36d/exec/java-exec/src/test/resources/tpchmulti/nation/01.parquet
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/tpchmulti/nation/01.parquet b/exec/java-exec/src/test/resources/tpchmulti/nation/01.parquet
new file mode 100644
index 0000000..ad9d93c
Binary files /dev/null and b/exec/java-exec/src/test/resources/tpchmulti/nation/01.parquet
differ

http://git-wip-us.apache.org/repos/asf/drill/blob/de89f36d/exec/java-exec/src/test/resources/tpchmulti/nation/02.parquet
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/tpchmulti/nation/02.parquet b/exec/java-exec/src/test/resources/tpchmulti/nation/02.parquet
new file mode 100644
index 0000000..e68f1f1
Binary files /dev/null and b/exec/java-exec/src/test/resources/tpchmulti/nation/02.parquet
differ

http://git-wip-us.apache.org/repos/asf/drill/blob/de89f36d/exec/java-exec/src/test/resources/tpchmulti/nation/03.parquet
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/tpchmulti/nation/03.parquet b/exec/java-exec/src/test/resources/tpchmulti/nation/03.parquet
new file mode 100644
index 0000000..e578e36
Binary files /dev/null and b/exec/java-exec/src/test/resources/tpchmulti/nation/03.parquet
differ

http://git-wip-us.apache.org/repos/asf/drill/blob/de89f36d/exec/java-exec/src/test/resources/tpchmulti/region/01.parquet
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/tpchmulti/region/01.parquet b/exec/java-exec/src/test/resources/tpchmulti/region/01.parquet
new file mode 100644
index 0000000..3c6da60
Binary files /dev/null and b/exec/java-exec/src/test/resources/tpchmulti/region/01.parquet
differ

http://git-wip-us.apache.org/repos/asf/drill/blob/de89f36d/exec/java-exec/src/test/resources/tpchmulti/region/02.parquet
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/tpchmulti/region/02.parquet b/exec/java-exec/src/test/resources/tpchmulti/region/02.parquet
new file mode 100644
index 0000000..f3c544a
Binary files /dev/null and b/exec/java-exec/src/test/resources/tpchmulti/region/02.parquet
differ

http://git-wip-us.apache.org/repos/asf/drill/blob/de89f36d/exec/java-exec/src/test/resources/tpchmulti/region/03.parquet
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/tpchmulti/region/03.parquet b/exec/java-exec/src/test/resources/tpchmulti/region/03.parquet
new file mode 100644
index 0000000..866ec62
Binary files /dev/null and b/exec/java-exec/src/test/resources/tpchmulti/region/03.parquet
differ


Mime
View raw message