morningman commented on code in PR #47593:
URL: https://github.com/apache/doris/pull/47593#discussion_r1947476695


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/paimon/PaimonExternalCatalog.java:
##########
@@ -113,35 +113,20 @@ public boolean tableExist(SessionContext ctx, String 
dbName, String tblName) {
     public List<String> listTableNames(SessionContext ctx, String dbName) {
         makeSureInitialized();
         try {
-            return hadoopAuthenticator.doAs(() -> {
-                List<String> tableNames = null;
-                try {
-                    tableNames = catalog.listTables(dbName);
-                } catch (Catalog.DatabaseNotExistException e) {
-                    LOG.warn("DatabaseNotExistException", e);
-                }
-                return tableNames;
-            });
-        } catch (IOException e) {
-            throw new RuntimeException("Failed to list table names, catalog 
name: " + getName(), e);
+            return hadoopAuthenticator.doAs(() -> catalog.listTables(dbName));

Review Comment:
   Before, if `Catalog.DatabaseNotExistException`, no exception will be thrown.



##########
fe/fe-core/src/main/java/org/apache/doris/datasource/paimon/PaimonExternalCatalog.java:
##########
@@ -113,35 +113,20 @@ public boolean tableExist(SessionContext ctx, String 
dbName, String tblName) {
     public List<String> listTableNames(SessionContext ctx, String dbName) {
         makeSureInitialized();
         try {
-            return hadoopAuthenticator.doAs(() -> {
-                List<String> tableNames = null;
-                try {
-                    tableNames = catalog.listTables(dbName);
-                } catch (Catalog.DatabaseNotExistException e) {
-                    LOG.warn("DatabaseNotExistException", e);
-                }
-                return tableNames;
-            });
-        } catch (IOException e) {
-            throw new RuntimeException("Failed to list table names, catalog 
name: " + getName(), e);
+            return hadoopAuthenticator.doAs(() -> catalog.listTables(dbName));
+        } catch (Exception e) {
+            throw new RuntimeException(
+                "Failed to list table names, catalog name: " + getName() + ", 
because " + e.getMessage(), e);
         }
     }
 
     public org.apache.paimon.table.Table getPaimonTable(String dbName, String 
tblName) {
         makeSureInitialized();
         try {
-            return hadoopAuthenticator.doAs(() -> {
-                org.apache.paimon.table.Table table = null;
-                try {
-                    table = catalog.getTable(Identifier.create(dbName, 
tblName));
-                } catch (Catalog.TableNotExistException e) {
-                    LOG.warn("TableNotExistException", e);
-                }
-                return table;
-            });
-        } catch (IOException e) {
-            throw new RuntimeException("Failed to get Paimon table, catalog 
name: " + getName() + ", db: "
-                    + dbName + ", table: " + tblName, e);
+            return hadoopAuthenticator.doAs(() -> 
catalog.getTable(Identifier.create(dbName, tblName)));

Review Comment:
   ditto



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

Reply via email to