nrg4878 commented on code in PR #4720:
URL: https://github.com/apache/hive/pull/4720#discussion_r1349142912
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/dataconnector/jdbc/AbstractJDBCConnectorProvider.java:
##########
@@ -234,9 +234,32 @@ protected boolean isClosed() {
return null;
}
- protected abstract ResultSet fetchTableMetadata(String tableName) throws
MetaException;
+ protected ResultSet fetchTableMetadata(String tableName) throws
MetaException {
+ ResultSet rs = null;
+ try {
+ rs = getConnection().getMetaData().getTables(getCatalogName(),
getDatabaseName(), null, new String[] { "TABLE" });
+ } catch (SQLException sqle) {
+ LOG.warn("Could not retrieve table names from remote datasource, cause:"
+ sqle.getMessage());
+ throw new MetaException("Could not retrieve table names from remote
datasource, cause:" + sqle.getMessage());
+ }
+ return rs;
+ }
- protected abstract ResultSet fetchTableNames() throws MetaException;
+ /**
+ * Returns a list of all table names from the remote database.
+ * @return List A collection of all the table names, null if there are no
tables.
+ * @throws MetaException To indicate any failures with executing this API
+ */
+ protected ResultSet fetchTableNames() throws MetaException {
+ ResultSet rs = null;
+ try {
+ rs = getConnection().getMetaData().getTables(getCatalogName(),
getDatabaseName(), null, new String[] { "TABLE" });
+ } catch (SQLException sqle) {
+ LOG.warn("Could not retrieve table names from remote datasource, cause:"
+ sqle.getMessage());
Review Comment:
fixed
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/dataconnector/jdbc/AbstractJDBCConnectorProvider.java:
##########
@@ -415,4 +438,7 @@ protected Properties getConnectionProperties() {
connectorPropMap.forEach((k, v) -> connectionProperties.put(k, v));
return connectionProperties;
}
-}
\ No newline at end of file
+
+ @Override
+ protected String getDatasourceType() { return type; };
Review Comment:
fixed
--
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]