drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] Ben-Zvi closed pull request #1456: DRILL-6729: Enable Unnest/Lateral Join feature by default
Date Sun, 09 Sep 2018 05:05:42 GMT
Ben-Zvi closed pull request #1456: DRILL-6729: Enable Unnest/Lateral Join feature by default
URL: https://github.com/apache/drill/pull/1456
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/ExecConstants.java b/exec/java-exec/src/main/java/org/apache/drill/exec/ExecConstants.java
index 2b4bae15811..2ecb3c87c8e 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/ExecConstants.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/ExecConstants.java
@@ -75,7 +75,6 @@ private ExecConstants() {
   public static final String SPOOLING_BUFFER_DELETE = "drill.exec.buffer.spooling.delete";
   public static final String SPOOLING_BUFFER_MEMORY = "drill.exec.buffer.spooling.size";
   public static final String BATCH_PURGE_THRESHOLD = "drill.exec.sort.purge.threshold";
-  public static final String ENABLE_UNNEST_LATERAL_KEY = "planner.enable_unnest_lateral";
 
   // Spill boot-time Options common to all spilling operators
   // (Each individual operator may override the common options)
diff --git a/exec/java-exec/src/main/resources/drill-module.conf b/exec/java-exec/src/main/resources/drill-module.conf
index d4cda92ff8b..e9e19403366 100644
--- a/exec/java-exec/src/main/resources/drill-module.conf
+++ b/exec/java-exec/src/main/resources/drill-module.conf
@@ -531,7 +531,7 @@ drill.exec.options: {
     planner.enable_topn: true,
     planner.enable_type_inference: true,
     planner.enable_unionall_distribute: false,
-    planner.enable_unnest_lateral: false,
+    planner.enable_unnest_lateral: true,
     planner.filter.max_selectivity_estimate_factor: 1.0,
     planner.filter.min_selectivity_estimate_factor: 0.0,
     planner.force_2phase_aggr: false,
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/lateraljoin/TestE2EUnnestAndLateral.java
b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/lateraljoin/TestE2EUnnestAndLateral.java
index 6578d0e7a19..7b29091636d 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/lateraljoin/TestE2EUnnestAndLateral.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/lateraljoin/TestE2EUnnestAndLateral.java
@@ -18,7 +18,6 @@
 package org.apache.drill.exec.physical.impl.lateraljoin;
 
 import org.apache.drill.categories.OperatorTest;
-import org.apache.drill.exec.ExecConstants;
 import org.apache.drill.exec.planner.physical.PlannerSettings;
 import org.apache.drill.test.ClusterFixture;
 import org.apache.drill.test.ClusterFixtureBuilder;
@@ -46,7 +45,7 @@ public static void setupTestFiles() throws Exception {
     dirTestWatcher.copyResourceToRoot(Paths.get("lateraljoin", "multipleFiles", regularTestFile_1));
     dirTestWatcher.copyResourceToRoot(Paths.get("lateraljoin", "multipleFiles", regularTestFile_2));
     ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher)
-        .sessionOption(ExecConstants.ENABLE_UNNEST_LATERAL_KEY, true)
+        .sessionOption(PlannerSettings.ENABLE_UNNEST_LATERAL_KEY, true)
         .maxParallelization(1);
     startCluster(builder);
   }
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/lateraljoin/TestLateralPlans.java
b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/lateraljoin/TestLateralPlans.java
index ef52f8e5cae..9adc3b5b1fa 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/lateraljoin/TestLateralPlans.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/lateraljoin/TestLateralPlans.java
@@ -259,7 +259,7 @@ public void testUnnestWithAggInSubquery() throws Exception {
         "t3(name, orders, items) on t.c_name = t3.name where t.c_id > 1 group by t.c_name";
 
     ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher)
-        .setOptionDefault(ExecConstants.ENABLE_UNNEST_LATERAL_KEY, true);
+        .setOptionDefault(PlannerSettings.ENABLE_UNNEST_LATERAL_KEY, true);
 
     try (ClusterFixture cluster = builder.build();
          ClientFixture client = cluster.clientFixture()) {
@@ -296,7 +296,7 @@ public void testUnnestWithAggOnOuterTable() throws Exception {
   public void testUnnestTableAndColumnAlias() throws Exception {
     String sql = "select t.c_name from cp.`lateraljoin/nested-customer.json` t, unnest(t.orders)
";
     ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher)
-        .setOptionDefault(ExecConstants.ENABLE_UNNEST_LATERAL_KEY, true);
+        .setOptionDefault(PlannerSettings.ENABLE_UNNEST_LATERAL_KEY, true);
 
     try (ClusterFixture cluster = builder.build();
          ClientFixture client = cluster.clientFixture()) {
@@ -313,7 +313,7 @@ public void testUnnestTableAndColumnAlias() throws Exception {
   public void testUnnestColumnAlias() throws Exception {
     String sql = "select t.c_name, t2.orders from cp.`lateraljoin/nested-customer.json` t,
unnest(t.orders) t2";
     ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher)
-        .setOptionDefault(ExecConstants.ENABLE_UNNEST_LATERAL_KEY, true);
+        .setOptionDefault(PlannerSettings.ENABLE_UNNEST_LATERAL_KEY, true);
 
     try (ClusterFixture cluster = builder.build();
          ClientFixture client = cluster.clientFixture()) {
@@ -336,7 +336,7 @@ public void testNoExchangeWithAggWithoutGrpBy() throws Exception {
     String sql = "select d1.totalprice from dfs.`lateraljoin/multipleFiles` t," +
             " lateral ( select sum(t2.ord.o_totalprice) as totalprice from unnest(t.c_orders)
t2(ord)) d1";
     ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher)
-            .setOptionDefault(ExecConstants.ENABLE_UNNEST_LATERAL_KEY, true)
+            .setOptionDefault(PlannerSettings.ENABLE_UNNEST_LATERAL_KEY, true)
             .setOptionDefault(ExecConstants.SLICE_TARGET, 1);
 
     try (ClusterFixture cluster = builder.build();
@@ -353,7 +353,7 @@ public void testNoExchangeWithStreamAggWithGrpBy() throws Exception {
             " lateral ( select sum(t2.ord.o_totalprice) as totalprice from unnest(t.c_orders)
t2(ord) group by t2.ord.o_orderkey) d1";
 
     ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher)
-            .setOptionDefault(ExecConstants.ENABLE_UNNEST_LATERAL_KEY, true)
+            .setOptionDefault(PlannerSettings.ENABLE_UNNEST_LATERAL_KEY, true)
             .setOptionDefault(ExecConstants.SLICE_TARGET, 1)
             .setOptionDefault(PlannerSettings.HASHAGG.getOptionName(), false)
             .setOptionDefault(PlannerSettings.STREAMAGG.getOptionName(), true);
@@ -371,7 +371,7 @@ public void testNoExchangeWithHashAggWithGrpBy() throws Exception {
     String sql = "select d1.totalprice from dfs.`lateraljoin/multipleFiles` t," +
             " lateral ( select sum(t2.ord.o_totalprice) as totalprice from unnest(t.c_orders)
t2(ord) group by t2.ord.o_orderkey) d1";
     ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher)
-            .setOptionDefault(ExecConstants.ENABLE_UNNEST_LATERAL_KEY, true)
+            .setOptionDefault(PlannerSettings.ENABLE_UNNEST_LATERAL_KEY, true)
             .setOptionDefault(ExecConstants.SLICE_TARGET, 1)
             .setOptionDefault(PlannerSettings.HASHAGG.getOptionName(), true)
             .setOptionDefault(PlannerSettings.STREAMAGG.getOptionName(), false);
@@ -389,7 +389,7 @@ public void testNoExchangeWithOrderByWithoutLimit() throws Exception {
     String Sql = "select d1.totalprice from dfs.`lateraljoin/multipleFiles` t," +
             " lateral ( select t2.ord.o_totalprice as totalprice from unnest(t.c_orders)
t2(ord) order by t2.ord.o_orderkey) d1";
     ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher)
-            .setOptionDefault(ExecConstants.ENABLE_UNNEST_LATERAL_KEY, true)
+            .setOptionDefault(PlannerSettings.ENABLE_UNNEST_LATERAL_KEY, true)
             .setOptionDefault(ExecConstants.SLICE_TARGET, 1);
 
     try (ClusterFixture cluster = builder.build();
@@ -405,7 +405,7 @@ public void testNoExchangeWithOrderByLimit() throws Exception {
     String sql = "select d1.totalprice from dfs.`lateraljoin/multipleFiles` t," +
             " lateral ( select t2.ord.o_totalprice as totalprice from unnest(t.c_orders)
t2(ord) order by t2.ord.o_orderkey limit 10) d1";
     ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher)
-            .setOptionDefault(ExecConstants.ENABLE_UNNEST_LATERAL_KEY, true)
+            .setOptionDefault(PlannerSettings.ENABLE_UNNEST_LATERAL_KEY, true)
             .setOptionDefault(ExecConstants.SLICE_TARGET, 1);
 
     try (ClusterFixture cluster = builder.build();
@@ -423,7 +423,7 @@ public void testNoExchangeWithLateralsDownStreamJoin() throws Exception
{
             " lateral ( select t2.ord.o_totalprice as totalprice from unnest(t.c_orders)
t2(ord) order by t2.ord.o_orderkey limit 10) d1" +
             " where t.c_name = t2.c_name";
     ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher)
-            .setOptionDefault(ExecConstants.ENABLE_UNNEST_LATERAL_KEY, true)
+            .setOptionDefault(PlannerSettings.ENABLE_UNNEST_LATERAL_KEY, true)
             .setOptionDefault(ExecConstants.SLICE_TARGET, 1);
 
     try (ClusterFixture cluster = builder.build();
@@ -440,7 +440,7 @@ public void testNoExchangeWithLateralsDownStreamUnion() throws Exception
{
             " select t.c_name from dfs.`lateraljoin/multipleFiles` t, " +
                     " lateral ( select t2.ord.o_totalprice as totalprice from unnest(t.c_orders)
t2(ord) order by t2.ord.o_orderkey limit 10) d1";
     ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher)
-            .setOptionDefault(ExecConstants.ENABLE_UNNEST_LATERAL_KEY, true)
+            .setOptionDefault(PlannerSettings.ENABLE_UNNEST_LATERAL_KEY, true)
             .setOptionDefault(ExecConstants.SLICE_TARGET, 1);
 
     try (ClusterFixture cluster = builder.build();
@@ -456,7 +456,7 @@ public void testNoExchangeWithLateralsDownStreamAgg() throws Exception
{
     String sql = "select sum(d1.totalprice) from dfs.`lateraljoin/multipleFiles` t, " +
             " lateral ( select t2.ord.o_totalprice as totalprice from unnest(t.c_orders)
t2(ord) order by t2.ord.o_orderkey limit 10) d1 group by t.c_custkey";
     ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher)
-            .setOptionDefault(ExecConstants.ENABLE_UNNEST_LATERAL_KEY, true)
+            .setOptionDefault(PlannerSettings.ENABLE_UNNEST_LATERAL_KEY, true)
             .setOptionDefault(ExecConstants.SLICE_TARGET, 1)
             .setOptionDefault(PlannerSettings.HASHAGG.getOptionName(), false)
             .setOptionDefault(PlannerSettings.STREAMAGG.getOptionName(), true);
@@ -482,7 +482,7 @@ private String getRightChildOfLateral(String explain) throws Exception
{
   public void testLateralAndUnnestExplainPlan() throws Exception {
     String sql = "select c.* from cp.`lateraljoin/nested-customer.json` c, unnest(c.orders)
Orders(ord)";
     ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher)
-            .setOptionDefault(ExecConstants.ENABLE_UNNEST_LATERAL_KEY, true)
+            .setOptionDefault(PlannerSettings.ENABLE_UNNEST_LATERAL_KEY, true)
             .setOptionDefault(ExecConstants.SLICE_TARGET, 1);
 
     try (ClusterFixture cluster = builder.build();
@@ -512,7 +512,7 @@ public void testUnnestTopN() throws Exception {
         "limit 50";
 
     ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher)
-        .setOptionDefault(ExecConstants.ENABLE_UNNEST_LATERAL_KEY, true);
+        .setOptionDefault(PlannerSettings.ENABLE_UNNEST_LATERAL_KEY, true);
 
     try (ClusterFixture cluster = builder.build();
          ClientFixture client = cluster.clientFixture()) {
@@ -537,7 +537,7 @@ public void testMultiUnnestQuery() throws Exception {
             "from (select flatten(c_orders) as orders from dfs.`lateraljoin/multipleFiles`
t) dt)dt order by 1";
 
     ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher)
-      .setOptionDefault(ExecConstants.ENABLE_UNNEST_LATERAL_KEY, true)
+      .setOptionDefault(PlannerSettings.ENABLE_UNNEST_LATERAL_KEY, true)
       .setOptionDefault(ExecConstants.SLICE_TARGET, 1);
 
     try (ClusterFixture cluster = builder.build();


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message