drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From meh...@apache.org
Subject [2/2] drill git commit: DRILL-3634: Add number of partitions information in the plan for hive scans
Date Wed, 04 Nov 2015 18:27:18 GMT
DRILL-3634: Add number of partitions information in the plan for hive scans

closes #231


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

Branch: refs/heads/master
Commit: 5db7f33b43cc7b06f32e956dba50376e3ddf9241
Parents: ea23efc
Author: Mehant Baid <mehantr@gmail.com>
Authored: Thu Oct 29 15:10:12 2015 -0700
Committer: Mehant Baid <mehantr@gmail.com>
Committed: Wed Nov 4 10:26:07 2015 -0800

----------------------------------------------------------------------
 .../exec/store/hive/HiveDrillNativeParquetScan.java    |  4 +++-
 .../org/apache/drill/exec/store/hive/HiveScan.java     | 13 ++++++++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/5db7f33b/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveDrillNativeParquetScan.java
----------------------------------------------------------------------
diff --git a/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveDrillNativeParquetScan.java
b/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveDrillNativeParquetScan.java
index 768e29d..41d06a9 100644
--- a/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveDrillNativeParquetScan.java
+++ b/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveDrillNativeParquetScan.java
@@ -43,8 +43,9 @@ public class HiveDrillNativeParquetScan extends HiveScan {
                                     @JsonProperty("hive-table") HiveReadEntry hiveReadEntry,
                                     @JsonProperty("storage-plugin") String storagePluginName,
                                     @JsonProperty("columns") List<SchemaPath> columns,
+                                    @JsonProperty("numPartitions") final int numPartitions,
                                     @JacksonInject StoragePluginRegistry pluginRegistry)
throws ExecutionSetupException {
-    super(userName, hiveReadEntry, storagePluginName, columns, pluginRegistry);
+    super(userName, hiveReadEntry, storagePluginName, columns, numPartitions, pluginRegistry);
   }
 
   public HiveDrillNativeParquetScan(String userName, HiveReadEntry hiveReadEntry, HiveStoragePlugin
storagePlugin,
@@ -105,6 +106,7 @@ public class HiveDrillNativeParquetScan extends HiveScan {
     return "HiveDrillNativeParquetScan [table=" + hiveReadEntry.getHiveTableWrapper()
         + ", inputSplits=" + inputSplits
         + ", columns=" + columns
+        + ", numPartitions=" + numPartitions
         + ", partitions= " + hiveReadEntry.getHivePartitionWrappers() +"]";
   }
 }

http://git-wip-us.apache.org/repos/asf/drill/blob/5db7f33b/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveScan.java
----------------------------------------------------------------------
diff --git a/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveScan.java
b/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveScan.java
index d52cc73..85a8595 100644
--- a/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveScan.java
+++ b/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveScan.java
@@ -87,6 +87,9 @@ public class HiveScan extends AbstractGroupScan {
   @JsonProperty("columns")
   public List<SchemaPath> columns;
 
+  @JsonProperty("numPartitions")
+  public final int numPartitions;
+
   @JsonIgnore
   List<List<InputSplit>> mappings;
 
@@ -104,6 +107,7 @@ public class HiveScan extends AbstractGroupScan {
                   @JsonProperty("hive-table") final HiveReadEntry hiveReadEntry,
                   @JsonProperty("storage-plugin") final String storagePluginName,
                   @JsonProperty("columns") final List<SchemaPath> columns,
+                  @JsonProperty("numPartitions") final int numPartitions,
                   @JacksonInject final StoragePluginRegistry pluginRegistry) throws ExecutionSetupException
{
     super(userName);
     this.hiveReadEntry = hiveReadEntry;
@@ -112,6 +116,7 @@ public class HiveScan extends AbstractGroupScan {
     this.columns = columns;
     getSplitsWithUGI();
     endpoints = storagePlugin.getContext().getBits();
+    this.numPartitions = numPartitions;
   }
 
   public HiveScan(final String userName, final HiveReadEntry hiveReadEntry, final HiveStoragePlugin
storagePlugin, final List<SchemaPath> columns) throws ExecutionSetupException {
@@ -122,6 +127,8 @@ public class HiveScan extends AbstractGroupScan {
     getSplitsWithUGI();
     endpoints = storagePlugin.getContext().getBits();
     this.storagePluginName = storagePlugin.getName();
+    List<HivePartition> partitions = hiveReadEntry.getHivePartitionWrappers();
+    numPartitions = partitions == null ? 0 : partitions.size();
   }
 
   public HiveScan(final HiveScan that) {
@@ -135,6 +142,7 @@ public class HiveScan extends AbstractGroupScan {
     this.storagePlugin = that.storagePlugin;
     this.storagePluginName = that.storagePluginName;
     this.rowCount = that.rowCount;
+    this.numPartitions = that.numPartitions;
   }
 
   public HiveScan clone(final HiveReadEntry hiveReadEntry) throws ExecutionSetupException
{
@@ -355,10 +363,13 @@ public class HiveScan extends AbstractGroupScan {
 
   @Override
   public String toString() {
+    List<HivePartition> partitions = hiveReadEntry.getHivePartitionWrappers();
+    int numPartitions = partitions == null ? 0 : partitions.size();
     return "HiveScan [table=" + hiveReadEntry.getHiveTableWrapper()
         + ", inputSplits=" + inputSplits
         + ", columns=" + columns
-        + ", partitions= " + hiveReadEntry.getHivePartitionWrappers() +"]";
+        + ", numPartitions=" + numPartitions
+        + ", partitions= " + partitions +"]";
   }
 
   @Override


Mime
View raw message