Repository: drill Updated Branches: refs/heads/master 475dfd801 -> c7c223662
DRILL-3380: Fix ParquetGroupScan clone Project: http://git-wip-us.apache.org/repos/asf/drill/repo Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/c6978a5c Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/c6978a5c Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/c6978a5c Branch: refs/heads/master Commit: c6978a5cce2a15b55c59695efd1e88764f90f3db Parents: 5f0e4cb Author: Steven Phillips <[email protected]> Authored: Thu Jun 25 16:56:42 2015 -0700 Committer: Steven Phillips <[email protected]> Committed: Thu Jun 25 17:38:43 2015 -0700 ---------------------------------------------------------------------- .../drill/exec/store/parquet/ParquetGroupScan.java | 13 +++++++++---- .../java/org/apache/drill/TestPartitionFilter.java | 12 ++++++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/drill/blob/c6978a5c/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetGroupScan.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetGroupScan.java b/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetGroupScan.java index ec28833..845bce9 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetGroupScan.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetGroupScan.java @@ -22,6 +22,7 @@ import java.security.PrivilegedExceptionAction; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; @@ -212,10 +213,10 @@ public class ParquetGroupScan extends AbstractFileGroupScan { this.rowCount = that.rowCount; this.rowGroupInfos = that.rowGroupInfos == null ? null : Lists.newArrayList(that.rowGroupInfos); this.selectionRoot = that.selectionRoot; - this.columnValueCounts = that.columnValueCounts; - this.columnTypeMap = that.columnTypeMap; - this.partitionValueMap = that.partitionValueMap; - this.fileSet = that.fileSet; + this.columnValueCounts = that.columnValueCounts == null ? null : new HashMap(that.columnValueCounts); + this.columnTypeMap = that.columnTypeMap == null ? null : new HashMap(that.columnTypeMap); + this.partitionValueMap = that.partitionValueMap == null ? null : new HashMap(that.partitionValueMap); + this.fileSet = that.fileSet == null ? null : new HashSet(that.fileSet); } @@ -272,6 +273,10 @@ public class ParquetGroupScan extends AbstractFileGroupScan { watch.start(); Timer.Context tContext = metrics.timer(READ_FOOTER_TIMER).time(); + columnTypeMap.clear(); + fileSet.clear(); + partitionValueMap.clear(); + rowGroupInfos = Lists.newArrayList(); long start = 0, length = 0; rowCount = 0; http://git-wip-us.apache.org/repos/asf/drill/blob/c6978a5c/exec/java-exec/src/test/java/org/apache/drill/TestPartitionFilter.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/test/java/org/apache/drill/TestPartitionFilter.java b/exec/java-exec/src/test/java/org/apache/drill/TestPartitionFilter.java index 565f7f1..44c59a0 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/TestPartitionFilter.java +++ b/exec/java-exec/src/test/java/org/apache/drill/TestPartitionFilter.java @@ -223,6 +223,18 @@ public class TestPartitionFilter extends PlanTestBase { testIncludeFilter(query, 6, "Filter", 9); } + @Test + public void testPartitoinFilter10_Parquet() throws Exception { + String query = String.format("select max(o_orderprice) from dfs_test.`%s/multilevel/parquet` where dir0=1994 and dir1='Q1'", TEST_RES_PATH); + testExcludeFilter(query, 1, "Filter", 1); + } + + @Test + public void testPartitoinFilter10_Parquet_from_CTAS() throws Exception { + String query = String.format("select max(o_orderprice) from dfs_test.tmp.parquet where yr=1994 and qrtr='Q1'", TEST_RES_PATH); + testExcludeFilter(query, 1, "Filter", 1); + } + @Test // see DRILL-2712 public void testMainQueryFalseCondition() throws Exception { String root = FileUtils.getResourceAsFile("/multilevel/parquet").toURI().toString();
