[GitHub] [hive] dantongdong commented on a change in pull request #2371: HIVE-25213: Implement List getTables() for existing connectors

Tue, 15 Jun 2021 10:19:59 -0700


dantongdong commented on a change in pull request #2371:
URL: https://github.com/apache/hive/pull/2371#discussion_r651997059



##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/dataconnector/jdbc/AbstractJDBCConnectorProvider.java
##########
@@ -129,7 +129,30 @@ protected Connection getConnection() {
    * @throws MetaException To indicate any failures with executing this API
    * @param regex
    */
-  @Override public abstract List<Table> getTables(String regex) throws 
MetaException;
+  @Override public List<Table> getTables(String regex) throws MetaException {
+    ResultSet rs = null;
+    try {
+      rs = fetchTablesViaDBMetaData(regex);
+      if (rs != null) {
+        List<Table> tables = new ArrayList<Table>();
+        while(rs.next()) {
+          tables.add(getTable(rs.getString(3)));

Review comment:
       If I am looking at the right 
[place](https://javadoc.scijava.org/Java6/java/sql/DatabaseMetaData.html). It 
does not specify its behavior neither. But I think it makes more sense to just 
leave out the one with column exception and continue returning the rest instead 
of stopping? Because we want the behavior to be as close as getTables(), we can 
just filter out the ones that has corrupted columns and return as many as we 
can.




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