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


##########
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:
   - `HiveConnection#getSessionValue(String, String)` and 
`HiveConnection#getUserName()` are both private methods. I guess what you mean 
is?
   ```java
     public String getUserName() throws SQLException {
       String username = 
connection.getConnParams().getSessionVars().get(JdbcConnectionParams.AUTH_USER);
       if ((username == null) || username.isEmpty()) {
         username = JdbcConnectionParams.ANONYMOUS_USER;
       }
       return username;
     }
   ```
   - Changing the `org.apache.hive.jdbc.TestJdbcDriver` doesn't seem intuitive 
enough, should I create a `org.apache.hive.jdbc.TestHiveDatabaseMetaData` class?
   - By the way, Jenkins used by Hive limits a single PR to 5 hours between two 
CIs, and the current PR's github tag is a bit inconsistent with the actual 
situation.



-- 
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: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to