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

fanng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git


The following commit(s) were added to refs/heads/main by this push:
     new c3c32fa98a [#8984] Improvement(paimon): Remove the redundant 
schemaExists() check in PaimonCatalogOperations.listTables() (#8985)
c3c32fa98a is described below

commit c3c32fa98a7e622629f240e8930bbfe7d442395a
Author: Xiaojian Sun <[email protected]>
AuthorDate: Fri Oct 31 18:39:04 2025 +0800

    [#8984] Improvement(paimon): Remove the redundant schemaExists() check in 
PaimonCatalogOperations.listTables() (#8985)
    
    ### What changes were proposed in this pull request?
    
    Remove the redundant schemaExists() check in
    PaimonCatalogOperations.listTables()
    
    ### Why are the changes needed?
    
    Fix: #([8984](https://github.com/apache/gravitino/issues/8984))
    
    ### Does this PR introduce _any_ user-facing change?
    
    N/A
    
    ### How was this patch tested?
    
    N/A
---
 .../catalog/lakehouse/paimon/PaimonCatalogOperations.java          | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git 
a/catalogs/catalog-lakehouse-paimon/src/main/java/org/apache/gravitino/catalog/lakehouse/paimon/PaimonCatalogOperations.java
 
b/catalogs/catalog-lakehouse-paimon/src/main/java/org/apache/gravitino/catalog/lakehouse/paimon/PaimonCatalogOperations.java
index 6fca33b283..cbcc024170 100644
--- 
a/catalogs/catalog-lakehouse-paimon/src/main/java/org/apache/gravitino/catalog/lakehouse/paimon/PaimonCatalogOperations.java
+++ 
b/catalogs/catalog-lakehouse-paimon/src/main/java/org/apache/gravitino/catalog/lakehouse/paimon/PaimonCatalogOperations.java
@@ -269,15 +269,14 @@ public class PaimonCatalogOperations implements 
CatalogOperations, SupportsSchem
   public NameIdentifier[] listTables(Namespace namespace) throws 
NoSuchSchemaException {
     String[] levels = namespace.levels();
     NameIdentifier schemaIdentifier = NameIdentifier.of(levels[levels.length - 
1]);
-    if (!schemaExists(schemaIdentifier)) {
-      throw new NoSuchSchemaException(NO_SUCH_SCHEMA_EXCEPTION, 
namespace.toString());
-    }
+
     List<String> tables;
     try {
       tables = paimonCatalogOps.listTables(schemaIdentifier.name());
     } catch (Catalog.DatabaseNotExistException e) {
-      throw new NoSuchSchemaException(NO_SUCH_SCHEMA_EXCEPTION, 
namespace.toString());
+      throw new NoSuchSchemaException(e, NO_SUCH_SCHEMA_EXCEPTION, 
namespace.toString());
     }
+
     return tables.stream()
         .map(
             tableIdentifier ->

Reply via email to