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/parquet/ParquetFormatPlugin.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/parquet/ParquetFormatPlugin.java')
-rw-r--r-- | exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetFormatPlugin.java | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetFormatPlugin.java b/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetFormatPlugin.java index df84a9d1c..17a950644 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetFormatPlugin.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetFormatPlugin.java @@ -276,6 +276,7 @@ public class ParquetFormatPlugin implements FormatPlugin { ParquetReaderConfig readerConfig = ParquetReaderConfig.builder().withFormatConfig(formatConfig).build(); ParquetTableMetadataDirs mDirs = Metadata.readMetadataDirs(fs, dirMetaPath, metaContext, readerConfig); if (mDirs != null && mDirs.getDirectories().size() > 0) { + metaContext.setDirectories(mDirs.getDirectories()); FileSelection dirSelection = FileSelection.createFromDirectories(mDirs.getDirectories(), selection, selection.getSelectionRoot() /* cacheFileRoot initially points to selectionRoot */); dirSelection.setExpandedPartial(); |