Repository: incubator-hawq
Updated Branches:
  refs/heads/HAWQ-459 55be00cee -> 58d8d406a


HAWQ-459. CR fixes


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

Branch: refs/heads/HAWQ-459
Commit: 58d8d406af973cc3d497355a0609709c23f60833
Parents: 55be00c
Author: Shivram Mani <[email protected]>
Authored: Mon Mar 21 17:21:18 2016 -0700
Committer: Shivram Mani <[email protected]>
Committed: Mon Mar 21 17:21:18 2016 -0700

----------------------------------------------------------------------
 .../java/org/apache/hawq/pxf/api/MetadataFetcher.java   | 12 ++++++------
 .../hawq/pxf/plugins/hive/utilities/HiveUtilities.java  | 10 ++--------
 .../src/main/resources/pxf-profiles-default.xml         |  4 ++--
 3 files changed, 10 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/58d8d406/pxf/pxf-api/src/main/java/org/apache/hawq/pxf/api/MetadataFetcher.java
----------------------------------------------------------------------
diff --git 
a/pxf/pxf-api/src/main/java/org/apache/hawq/pxf/api/MetadataFetcher.java 
b/pxf/pxf-api/src/main/java/org/apache/hawq/pxf/api/MetadataFetcher.java
index 5dc56dc..1ce0887 100644
--- a/pxf/pxf-api/src/main/java/org/apache/hawq/pxf/api/MetadataFetcher.java
+++ b/pxf/pxf-api/src/main/java/org/apache/hawq/pxf/api/MetadataFetcher.java
@@ -1,10 +1,5 @@
 package org.apache.hawq.pxf.api;
 
-import java.util.List;
-
-import org.apache.hawq.pxf.api.utilities.InputData;
-import org.apache.hawq.pxf.api.utilities.Plugin;
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -24,6 +19,11 @@ import org.apache.hawq.pxf.api.utilities.Plugin;
  * under the License.
  */
 
+import java.util.List;
+
+import org.apache.hawq.pxf.api.utilities.InputData;
+import org.apache.hawq.pxf.api.utilities.Plugin;
+
 
 /**
  * Abstract class that defines getting metadata of an item.
@@ -41,7 +41,7 @@ public abstract class MetadataFetcher extends Plugin {
     }
 
     /**
-     * Gets a metadata of a given table
+     * Gets a metadata of a given item
      *
      * @param pattern table/file name or pattern
      * @return metadata of all items corresponding to given pattern

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/58d8d406/pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/utilities/HiveUtilities.java
----------------------------------------------------------------------
diff --git 
a/pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/utilities/HiveUtilities.java
 
b/pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/utilities/HiveUtilities.java
index 1ac575f..3d06101 100644
--- 
a/pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/utilities/HiveUtilities.java
+++ 
b/pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/utilities/HiveUtilities.java
@@ -210,7 +210,7 @@ public class HiveUtilities {
     public static Metadata.Item extractTableFromName(String qualifiedName) {
         List<Metadata.Item> items = extractTablesFromPattern(null, 
qualifiedName);
         if(items.isEmpty()) {
-            return null;
+            throw new IllegalArgumentException("No tables found");
         }
         return items.get(0);
     }
@@ -271,12 +271,9 @@ public class HiveUtilities {
         }
 
         try {
-            /*if(dbPattern.contains(WILDCARD)) {
-                databases.addAll(client.getAllDatabases());
-            }*/
             databases = client.getDatabases(dbPattern);
             if(databases.isEmpty()) {
-                throw new IllegalArgumentException("no database found for the 
given pattern");
+                throw new IllegalArgumentException("No database found for the 
given pattern");
             }
             for(String dbName: databases) {
                 for(String tableName: client.getTables(dbName, tablePattern)) {
@@ -285,9 +282,6 @@ public class HiveUtilities {
                     }
                 }
             }
-            if(itemList.isEmpty()) {
-                throw new IllegalArgumentException("no tables found");
-            }
             return itemList;
 
         } catch (MetaException cause) {

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/58d8d406/pxf/pxf-service/src/main/resources/pxf-profiles-default.xml
----------------------------------------------------------------------
diff --git a/pxf/pxf-service/src/main/resources/pxf-profiles-default.xml 
b/pxf/pxf-service/src/main/resources/pxf-profiles-default.xml
index e7afdce..9fc2bd2 100644
--- a/pxf/pxf-service/src/main/resources/pxf-profiles-default.xml
+++ b/pxf/pxf-service/src/main/resources/pxf-profiles-default.xml
@@ -54,7 +54,7 @@ under the License.
     </profile>
     <profile>
         <name>HiveRC</name>
-        <description>This profile is suitable only for Hive items stored in RC 
files
+        <description>This profile is suitable only for Hive tables stored in 
RC files
             and serialized with either the ColumnarSerDe or the 
LazyBinaryColumnarSerDe.
             It is much faster than the general purpose Hive profile.
             DELIMITER parameter is mandatory.
@@ -68,7 +68,7 @@ under the License.
     </profile>
     <profile>
         <name>HiveText</name>
-        <description>This profile is suitable only for Hive items stored as 
Text files.
+        <description>This profile is suitable only for Hive tables stored as 
Text files.
             It is much faster than the general purpose Hive profile.
             DELIMITER parameter is mandatory.
         </description>

Reply via email to