hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kavin...@apache.org
Subject incubator-hawq git commit: HAWQ-1440. Support ANALYZE for all Hive External Tables
Date Mon, 01 May 2017 16:49:53 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master e082d3adb -> 0a754883f


HAWQ-1440. Support ANALYZE for all Hive External Tables


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/0a754883
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/0a754883
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/0a754883

Branch: refs/heads/master
Commit: 0a754883f2b9c02e6c85a50e1aa82d853791d09e
Parents: e082d3a
Author: Kavinder Dhaliwal <kavinderd@gmail.com>
Authored: Tue Apr 25 15:14:47 2017 -0700
Committer: Kavinder Dhaliwal <kavinderd@gmail.com>
Committed: Mon May 1 09:46:44 2017 -0700

----------------------------------------------------------------------
 .../apache/hawq/pxf/plugins/hive/HiveDataFragmenter.java | 11 +++++++++--
 .../hawq/pxf/plugins/hive/HiveInputFormatFragmenter.java |  2 +-
 2 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/0a754883/pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/HiveDataFragmenter.java
----------------------------------------------------------------------
diff --git a/pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/HiveDataFragmenter.java
b/pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/HiveDataFragmenter.java
index a03d3b7..9cf8f27 100644
--- a/pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/HiveDataFragmenter.java
+++ b/pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/HiveDataFragmenter.java
@@ -466,7 +466,14 @@ public class HiveDataFragmenter extends Fragmenter {
      */
     @Override
     public FragmentsStats getFragmentsStats() throws Exception {
-        throw new UnsupportedOperationException(
-                "ANALYZE for Hive plugin is not supported");
+        Metadata.Item tblDesc = HiveUtilities.extractTableFromName(inputData.getDataSource());
+        Table tbl = HiveUtilities.getHiveTable(client, tblDesc);
+        Metadata metadata = new Metadata(tblDesc);
+        HiveUtilities.getSchema(tbl, metadata);
+
+        long split_count = Long.parseLong(tbl.getParameters().get("numFiles"));
+        long totalSize = Long.parseLong(tbl.getParameters().get("totalSize"));
+        long firstFragmentSize = totalSize / split_count;
+        return new FragmentsStats(split_count, firstFragmentSize, totalSize);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/0a754883/pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/HiveInputFormatFragmenter.java
----------------------------------------------------------------------
diff --git a/pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/HiveInputFormatFragmenter.java
b/pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/HiveInputFormatFragmenter.java
index 9199118..b133e1d 100644
--- a/pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/HiveInputFormatFragmenter.java
+++ b/pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/HiveInputFormatFragmenter.java
@@ -121,6 +121,6 @@ public class HiveInputFormatFragmenter extends HiveDataFragmenter {
      */
     @Override
     public FragmentsStats getFragmentsStats() throws Exception {
-        throw new UnsupportedOperationException("ANALYZE for HiveRc, HiveText, and HiveOrc
plugins is not supported");
+        return  super.getFragmentsStats();
     }
 }


Mime
View raw message