diff options
author | Bohdan Kazydub <bohdan.kazydub@gmail.com> | 2019-02-13 01:14:14 +0200 |
---|---|---|
committer | Sorabh Hamirwasia <sorabh@apache.org> | 2019-03-14 15:36:10 -0700 |
commit | a99db5fe53084a18a83e589ae529ffe5edbcc0a8 (patch) | |
tree | a3c48a0311f248a550cc6c2377936d384e03322e /exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/MetadataContext.java | |
parent | e2619f6e09da53730fb3281fe9fad663f564a2c2 (diff) |
DRILL-7038: Queries on partitioned columns scan the entire datasets
- Added new optimizer rule which checks if query references directory columns only and has DISTINCT or GROUP BY operation. If the condition holds, instead of scanning full file set the following will be performed:
1) if there is cache metadata file, these directories will be read from it,
2) otherwise directories will be gathered from selection object (PartitionLocation).
In the end Scan node will be transformed to DrillValuesRel (containing constant literals) with gathered values so no scan will be performed.
closes #1640
Diffstat (limited to 'exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/MetadataContext.java')
-rw-r--r-- | exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/MetadataContext.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/MetadataContext.java b/exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/MetadataContext.java index 073847812..5d3c18e92 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/MetadataContext.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/MetadataContext.java @@ -17,6 +17,7 @@ */ package org.apache.drill.exec.store.dfs; +import java.util.List; import java.util.Map; import org.apache.drill.shaded.guava.com.google.common.collect.Maps; @@ -39,6 +40,8 @@ public class MetadataContext { private boolean metadataCacheCorrupted; + private List<Path> directories; + public void setStatus(Path dir) { dirModifCheckMap.put(dir, true); } @@ -83,6 +86,14 @@ public class MetadataContext { this.metadataCacheCorrupted = metadataCacheCorrupted; } + public void setDirectories(List<Path> directories) { + this.directories = directories; + } + + public List<Path> getDirectories() { + return directories; + } + public enum PruneStatus { NOT_STARTED, // initial state PRUNED, // partitions were pruned |