InvisibleProgrammer commented on code in PR #5554:
URL: https://github.com/apache/hive/pull/5554#discussion_r1854012159


##########
jdbc/src/java/org/apache/hive/jdbc/HiveDatabaseMetaData.java:
##########
@@ -744,12 +744,12 @@ public <T> T getObject(int columnIndex, Class<T> type) 
throws SQLException {
     };
   }
 
-  public String getURL() throws SQLException {
-    throw new SQLFeatureNotSupportedException("Method not supported");
+  public String getURL() {
+    return connection.getConnectedUrl();
   }
 
   public String getUserName() throws SQLException {
-    throw new SQLFeatureNotSupportedException("Method not supported");
+    return connection.getConnParams().getSessionVars().get("user");

Review Comment:
   I think it would be more bullet-proof to get the user name similar way as 
HiveConnection does: It gets the username, or it is not provided, gives back 
the anonymous: 
   
   ```java
     /**
      * @return username from sessConfMap
      */
     private String getUserName() {
       return getSessionValue(JdbcConnectionParams.AUTH_USER, 
JdbcConnectionParams.ANONYMOUS_USER);
     }
    ```



-- 
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.

To unsubscribe, e-mail: [email protected]

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