ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject [30/50] ambari git commit: AMBARI-13988. Hive View : Upload Table Tab : if selected datatabase is default then data does not show in table. (Nitiraj Rathore via yusaku)
Date Tue, 01 Dec 2015 18:20:20 GMT
AMBARI-13988. Hive View : Upload Table Tab : if selected datatabase is default then data does
not show in table. (Nitiraj Rathore via yusaku)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 0ada28abc97e1b54833b98340a43e09c948a7e25
Parents: 89c6f26
Author: Yusaku Sako <yusaku@hortonworks.com>
Authored: Mon Nov 30 15:56:13 2015 -0800
Committer: Yusaku Sako <yusaku@hortonworks.com>
Committed: Mon Nov 30 15:56:13 2015 -0800

----------------------------------------------------------------------
 .../ambari/view/hive/resources/uploads/UploadService.java       | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0ada28ab/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/UploadService.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/UploadService.java
b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/UploadService.java
index 2098a5f..8b5b851 100644
--- a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/UploadService.java
+++ b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/UploadService.java
@@ -64,6 +64,7 @@ public class UploadService extends BaseService {
 
   final private String HIVE_META_STORE_LOCATION_KEY = "hive.metastore.warehouse.dir";
   final private String HIVE_SITE = "hive-site";
+  final private String HIVE_DEFAULT_DB = "default";
 
   @POST
   @Path("/preview")
@@ -173,7 +174,8 @@ public class UploadService extends BaseService {
     createdJobController.submit();
     getResourceManager().saveIfModified(createdJobController);
 
-    String filePath = databaseName + ".db/" + tableName + "/" + tableName + ".csv";
+    String filePath = (databaseName == null || databaseName.equals(HIVE_DEFAULT_DB)) ? ""
: databaseName + ".db/";
+    filePath += tableName + "/" + tableName + ".csv";
 
     JSONObject jobObject = new JSONObject();
     jobObject.put("jobId", job.getId());
@@ -236,7 +238,6 @@ public class UploadService extends BaseService {
       br.readLine(); // TODO : remove the header line. Wrong if first record is beyond first
endline
     }
 
-
     String basePath = getHiveMetaStoreLocation();
     if (null == basePath)
       basePath = "/apps/hive/warehouse";


Mime
View raw message