This is an automated email from the ASF dual-hosted git repository.

zhangbutao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new 09553fca66f HIVE-28349: SHOW TABLES with invalid connector, giving 0 
results, instead of failing (#5321)(Sai Hemanth Gantasala, reviewed by Butao 
Zhang)
09553fca66f is described below

commit 09553fca66ff69ff870c8a181750b70d81a8640e
Author: Sai Hemanth Gantasala 
<[email protected]>
AuthorDate: Wed Jul 24 18:17:15 2024 -0700

    HIVE-28349: SHOW TABLES with invalid connector, giving 0 results, instead 
of failing (#5321)(Sai Hemanth Gantasala, reviewed by Butao Zhang)
---
 .../java/org/apache/hadoop/hive/metastore/HMSHandler.java     | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git 
a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java
 
b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java
index e770a953afa..a88fa55af6e 100644
--- 
a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java
+++ 
b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java
@@ -3837,7 +3837,12 @@ public class HMSHandler extends FacebookBase implements 
IHMSHandler {
       return FilterUtils.filterTablesIfEnabled(isServerFilterEnabled, 
filterHook, tables);
     } catch (Exception e) {
       LOG.warn("Unexpected exception while getting table(s) in remote database 
" + dbname , e);
-      return new ArrayList<Table>();
+      if (isInTest) {
+        // ignore the exception
+        return new ArrayList<Table>();
+      } else {
+        throw newMetaException(e);
+      }
     }
   }
 
@@ -6312,7 +6317,9 @@ public class HMSHandler extends FacebookBase implements 
IHMSHandler {
         Database db = get_database_core(parsedDbName[CAT_NAME], 
parsedDbName[DB_NAME]);
         return 
DataConnectorProviderFactory.getDataConnectorProvider(db).getTableNames();
       }
-    } catch (Exception e) { /* appears we return empty set instead of throwing 
an exception */ }
+    } catch (Exception e) {
+      throw newMetaException(e);
+    }
 
     try {
       ret = getMS().getTables(parsedDbName[CAT_NAME], parsedDbName[DB_NAME], 
pattern);

Reply via email to