drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [4/4] drill git commit: DRILL-2517: (Prototype from Adam) Apply directory-based pruning before reading file.
Date Sat, 30 Jan 2016 04:38:34 GMT
DRILL-2517: (Prototype from Adam) Apply directory-based pruning before reading file.


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

Branch: refs/heads/master
Commit: 09de31edfa74e09a9a79b9a0fc995b33d70f3935
Parents: 03197d0
Author: AdamPD <adam@pharmadata.net.au>
Authored: Mon Jan 18 10:40:54 2016 -0800
Committer: Jinfeng Ni <jni@apache.org>
Committed: Fri Jan 29 19:30:27 2016 -0800

----------------------------------------------------------------------
 .../drill/exec/planner/logical/DrillRuleSets.java |  2 +-
 .../drill/exec/planner/logical/DrillTable.java    |  4 ++++
 .../planner/logical/partition/PruneScanRule.java  | 18 ++++++++++++------
 3 files changed, 17 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/09de31ed/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRuleSets.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRuleSets.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRuleSets.java
index b7974f3..6f1f995 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRuleSets.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRuleSets.java
@@ -141,10 +141,10 @@ public class DrillRuleSets {
        */
       DrillPushProjectPastFilterRule.INSTANCE,
       DrillPushProjectPastJoinRule.INSTANCE,
-      DrillPushProjIntoScan.INSTANCE,
       // Due to infinite loop in planning (DRILL-3257), temporarily disable this rule
       //DrillProjectSetOpTransposeRule.INSTANCE,
       ProjectWindowTransposeRule.INSTANCE,
+      DrillPushProjIntoScan.INSTANCE,
 
       /*
        Convert from Calcite Logical to Drill Logical Rules.

http://git-wip-us.apache.org/repos/asf/drill/blob/09de31ed/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillTable.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillTable.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillTable.java
index 61f242f..106290d 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillTable.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillTable.java
@@ -85,6 +85,10 @@ public abstract class DrillTable implements Table {
     return selection;
   }
 
+  public void modifySelection(Object selection) {
+    this.selection = selection;
+  }
+
   public String getStorageEngineName() {
     return storageEngineName;
   }

http://git-wip-us.apache.org/repos/asf/drill/blob/09de31ed/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/partition/PruneScanRule.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/partition/PruneScanRule.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/partition/PruneScanRule.java
index ab6c5a8..4cc9c46 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/partition/PruneScanRule.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/partition/PruneScanRule.java
@@ -24,6 +24,9 @@ import java.util.Map;
 import java.util.concurrent.TimeUnit;
 
 import com.google.common.base.Stopwatch;
+import org.apache.calcite.adapter.enumerable.EnumerableTableScan;
+import org.apache.calcite.rel.core.Filter;
+import org.apache.calcite.rel.core.Project;
 import org.apache.calcite.rex.RexUtil;
 import org.apache.calcite.util.BitSets;
 
@@ -50,6 +53,7 @@ import org.apache.drill.exec.planner.logical.DrillParseContext;
 import org.apache.drill.exec.planner.logical.DrillProjectRel;
 import org.apache.drill.exec.planner.logical.DrillRel;
 import org.apache.drill.exec.planner.logical.DrillScanRel;
+import org.apache.drill.exec.planner.logical.DrillTable;
 import org.apache.drill.exec.planner.logical.RelOptHelper;
 import org.apache.drill.exec.planner.physical.PlannerSettings;
 import org.apache.drill.exec.planner.physical.PrelUtil;
@@ -80,7 +84,7 @@ public abstract class PruneScanRule extends StoragePluginOptimizerRule {
 
   public static final RelOptRule getFilterOnProject(OptimizerRulesContext optimizerRulesContext)
{
     return new PruneScanRule(
-        RelOptHelper.some(DrillFilterRel.class, RelOptHelper.some(DrillProjectRel.class,
RelOptHelper.any(DrillScanRel.class))),
+        RelOptHelper.some(Filter.class, RelOptHelper.some(Project.class, RelOptHelper.any(EnumerableTableScan.class))),
         "PruneScanRule:Filter_On_Project",
         optimizerRulesContext) {
 
@@ -103,9 +107,9 @@ public abstract class PruneScanRule extends StoragePluginOptimizerRule
{
 
       @Override
       public void onMatch(RelOptRuleCall call) {
-        final DrillFilterRel filterRel = (DrillFilterRel) call.rel(0);
-        final DrillProjectRel projectRel = (DrillProjectRel) call.rel(1);
-        final DrillScanRel scanRel = (DrillScanRel) call.rel(2);
+        final FilterRel filterRel = (DrillFilterRel) call.rel(0);
+        final ProjectRel projectRel = (DrillProjectRel) call.rel(1);
+        final ScanRel scanRel = (DrillScanRel) call.rel(2);
         doOnMatch(call, filterRel, projectRel, scanRel);
       }
     };
@@ -113,7 +117,7 @@ public abstract class PruneScanRule extends StoragePluginOptimizerRule
{
 
   public static final RelOptRule getFilterOnScan(OptimizerRulesContext optimizerRulesContext)
{
     return new PruneScanRule(
-        RelOptHelper.some(DrillFilterRel.class, RelOptHelper.any(DrillScanRel.class)),
+        RelOptHelper.some(Filter.class, RelOptHelper.any(EnumerableTableScan.class)),
         "PruneScanRule:Filter_On_Scan", optimizerRulesContext) {
 
       @Override
@@ -142,7 +146,9 @@ public abstract class PruneScanRule extends StoragePluginOptimizerRule
{
     };
   }
 
-  protected void doOnMatch(RelOptRuleCall call, DrillFilterRel filterRel, DrillProjectRel
projectRel, DrillScanRel scanRel) {
+  protected void doOnMatch(RelOptRuleCall call, Filter filterRel, Project projectRel,  DrillScanRel
scanRel) {
+    final DrillTable table = scanRel.getTable().unwrap(DrillTable.class);
+
     final String pruningClassName = getClass().getName();
     logger.info("Beginning partition pruning, pruning class: {}", pruningClassName);
     Stopwatch totalPruningTime = new Stopwatch();


Mime
View raw message