Return-Path: X-Original-To: apmail-drill-commits-archive@www.apache.org Delivered-To: apmail-drill-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 35FE5F859 for ; Fri, 12 Dec 2014 16:24:08 +0000 (UTC) Received: (qmail 11810 invoked by uid 500); 12 Dec 2014 16:24:08 -0000 Delivered-To: apmail-drill-commits-archive@drill.apache.org Received: (qmail 11747 invoked by uid 500); 12 Dec 2014 16:24:07 -0000 Mailing-List: contact commits-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: commits@drill.apache.org Delivered-To: mailing list commits@drill.apache.org Received: (qmail 11673 invoked by uid 99); 12 Dec 2014 16:24:07 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Dec 2014 16:24:07 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 87FE3A29CC2; Fri, 12 Dec 2014 16:24:07 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: parthc@apache.org To: commits@drill.apache.org Date: Fri, 12 Dec 2014 16:24:14 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [08/10] drill git commit: DRILL-1845: Do not pass partition columns to parquet reader DRILL-1845: Do not pass partition columns to parquet reader Project: http://git-wip-us.apache.org/repos/asf/drill/repo Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/dabfbfea Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/dabfbfea Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/dabfbfea Branch: refs/heads/0.7.0 Commit: dabfbfeaaeeb703a372633bbf7af60e4ac29550d Parents: c587dff Author: Hanifi Gunes Authored: Thu Dec 11 15:06:51 2014 -0800 Committer: Parth Chandra Committed: Thu Dec 11 16:58:50 2014 -0800 ---------------------------------------------------------------------- .../org/apache/drill/exec/physical/base/GroupScan.java | 3 ++- .../exec/store/parquet/ParquetScanBatchCreator.java | 13 +++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/drill/blob/dabfbfea/exec/java-exec/src/main/java/org/apache/drill/exec/physical/base/GroupScan.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/base/GroupScan.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/base/GroupScan.java index 935d817..23860a3 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/base/GroupScan.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/base/GroupScan.java @@ -19,6 +19,7 @@ package org.apache.drill.exec.physical.base; import java.util.List; +import com.google.common.collect.ImmutableList; import org.apache.drill.common.exceptions.ExecutionSetupException; import org.apache.drill.common.expression.SchemaPath; import org.apache.drill.exec.physical.PhysicalOperatorSetupException; @@ -33,7 +34,7 @@ import com.google.common.collect.Lists; */ public interface GroupScan extends Scan, HasAffinity{ - public static final List ALL_COLUMNS = Lists.newArrayList(SchemaPath.getSimplePath("*")); + public static final List ALL_COLUMNS = ImmutableList.of(SchemaPath.getSimplePath("*")); public static final long NO_COLUMN_STATS = -1; public abstract void applyAssignments(List endpoints) throws PhysicalOperatorSetupException; http://git-wip-us.apache.org/repos/asf/drill/blob/dabfbfea/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetScanBatchCreator.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetScanBatchCreator.java b/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetScanBatchCreator.java index 53a6ffc..dc1d892 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetScanBatchCreator.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetScanBatchCreator.java @@ -29,6 +29,7 @@ import org.apache.drill.common.exceptions.ExecutionSetupException; import org.apache.drill.common.expression.SchemaPath; import org.apache.drill.exec.ExecConstants; import org.apache.drill.exec.ops.FragmentContext; +import org.apache.drill.exec.physical.base.GroupScan; import org.apache.drill.exec.physical.impl.BatchCreator; import org.apache.drill.exec.physical.impl.ScanBatch; import org.apache.drill.exec.record.RecordBatch; @@ -68,20 +69,24 @@ public class ParquetScanBatchCreator implements BatchCreator selectedPartitionColumns = Lists.newArrayList(); boolean selectAllColumns = AbstractRecordReader.isStarQuery(columns); + List newColumns = columns; if (!selectAllColumns) { - List newColums = Lists.newArrayList(); + newColumns = Lists.newArrayList(); Pattern pattern = Pattern.compile(String.format("%s[0-9]+", partitionDesignator)); for (SchemaPath column : columns) { Matcher m = pattern.matcher(column.getAsUnescapedPath()); if (m.matches()) { selectedPartitionColumns.add(Integer.parseInt(column.getAsUnescapedPath().toString().substring(partitionDesignator.length()))); } else { - newColums.add(column); + newColumns.add(column); } } + if (newColumns.isEmpty()) { + newColumns = GroupScan.ALL_COLUMNS; + } final int id = rowGroupScan.getOperatorId(); // Create the new row group scan with the new columns - rowGroupScan = new ParquetRowGroupScan(rowGroupScan.getStorageEngine(), rowGroupScan.getRowGroupReadEntries(), newColums, rowGroupScan.getSelectionRoot()); + rowGroupScan = new ParquetRowGroupScan(rowGroupScan.getStorageEngine(), rowGroupScan.getRowGroupReadEntries(), newColumns, rowGroupScan.getSelectionRoot()); rowGroupScan.setOperatorId(id); } @@ -118,7 +123,7 @@ public class ParquetScanBatchCreator implements BatchCreator