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 fbe6f4be49d..12710a26878 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 @@ -126,7 +126,10 @@ public void initialize( */ @Override public NameIdentifier[] listSchemas(Namespace namespace) throws NoSuchCatalogException { + // Paimon JDBC catalog backend may produce duplicate schema names, remove the duplicate schema + // in Gravitino side util the bug is fixed in Paimon return paimonCatalogOps.listDatabases().stream() + .distinct() .map(paimonNamespace -> NameIdentifier.of(namespace, paimonNamespace)) .toArray(NameIdentifier[]::new); }