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

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


The following commit(s) were added to refs/heads/master by this push:
     new 534f2b0c5 [hive] Make HiveCatalog.listTables Lighter weight (#4498)
534f2b0c5 is described below

commit 534f2b0c59e64564c51d5deff8ace384a8c10d38
Author: Jingsong Lee <[email protected]>
AuthorDate: Tue Nov 12 09:58:56 2024 +0800

    [hive] Make HiveCatalog.listTables Lighter weight (#4498)
---
 .../src/main/java/org/apache/paimon/hive/HiveCatalog.java      | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git 
a/paimon-hive/paimon-hive-catalog/src/main/java/org/apache/paimon/hive/HiveCatalog.java
 
b/paimon-hive/paimon-hive-catalog/src/main/java/org/apache/paimon/hive/HiveCatalog.java
index a1950c374..51c800e56 100644
--- 
a/paimon-hive/paimon-hive-catalog/src/main/java/org/apache/paimon/hive/HiveCatalog.java
+++ 
b/paimon-hive/paimon-hive-catalog/src/main/java/org/apache/paimon/hive/HiveCatalog.java
@@ -391,10 +391,14 @@ public class HiveCatalog extends AbstractCatalog {
         try {
             List<String> allTables = clients.run(client -> 
client.getAllTables(databaseName));
             List<String> result = new ArrayList<>(allTables.size());
-            for (String table : allTables) {
+            for (String t : allTables) {
                 try {
-                    getTable(new Identifier(databaseName, table));
-                    result.add(table);
+                    Identifier identifier = new Identifier(databaseName, t);
+                    Table table = getHmsTable(identifier);
+                    if (isPaimonTable(identifier, table)
+                            || (!formatTableDisabled() && 
isFormatTable(table))) {
+                        result.add(t);
+                    }
                 } catch (TableNotExistException ignored) {
                 }
             }

Reply via email to