nrg4878 commented on a change in pull request #2037:
URL: https://github.com/apache/hive/pull/2037#discussion_r601864448



##########
File path: 
ql/src/java/org/apache/hadoop/hive/ql/ddl/database/desc/DescDatabaseOperation.java
##########
@@ -52,14 +53,22 @@ public int execute() throws HiveException {
         params = new TreeMap<>(database.getParameters());
       }
 
-      String location = database.getLocationUri();
-      if (HiveConf.getBoolVar(context.getConf(), 
HiveConf.ConfVars.HIVE_IN_TEST)) {
-        location = "location/in/test";
-      }
-
+      String location = "";
       DescDatabaseFormatter formatter = 
DescDatabaseFormatter.getFormatter(context.getConf());
-      formatter.showDatabaseDescription(outStream, database.getName(), 
database.getDescription(), location,
-          database.getManagedLocationUri(), database.getOwnerName(), 
database.getOwnerType(), params);
+      if (database.getType() == DatabaseType.NATIVE) {
+        location = database.getLocationUri();
+        if (HiveConf.getBoolVar(context.getConf(), 
HiveConf.ConfVars.HIVE_IN_TEST)) {
+          location = "location/in/test";
+        }
+        // database.setRemote_dbname("");
+        // database.setConnector_name("");
+
+        formatter.showDatabaseDescription(outStream, database.getName(), 
database.getDescription(), location,
+          database.getManagedLocationUri(), database.getOwnerName(), 
database.getOwnerType(), params, "", "");
+      } else {
+        formatter.showDatabaseDescription(outStream, database.getName(), 
database.getDescription(), "", "",
+          database.getOwnerName(), database.getOwnerType(), params, 
database.getConnector_name(), database.getRemote_dbname());
+      }
     } catch (Exception e) {
       throw new HiveException(e, ErrorMsg.GENERIC_ERROR);

Review comment:
       we are not casting it to Exception, we are just catching any Exception 
thats thrown in this block and throwing a HiveException. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to