linghengqian commented on code in PR #5554:
URL: https://github.com/apache/hive/pull/5554#discussion_r1854153479
##########
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 added new unit tests. I guess Hive Doc does not prohibit the use of
Guava's utility classes in unit tests.
- I must admit that I found the Hive Contributor Guide on ASF Confluence to
be out of date, and I had to spend some time looking up how to start a single
unit test locally.
```shell
sdk install java 8.0.422-tem
sdk use java 8.0.422-tem
sdk install maven
mvn clean install -DskipTests -Pitests
mvn test -Dtest=TestHiveDatabaseMetaData -Dtest.output.overwrite=true -pl
itests/hive-unit -Pitests
```
--
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]