Skip to content

Commit

Permalink
[apache#5424] fix(paimon): remove duplicate schema names for Paimon c…
Browse files Browse the repository at this point in the history
…atalog JDBC backend (apache#5434)

### What changes were proposed in this pull request?

remove duplicate schema names after list schemas from Paimon

### Why are the changes needed?

Fix: apache#5424 

### Does this PR introduce _any_ user-facing change?
no

### How was this patch tested?
test in local env, create schema s1, create table t1, will get only one
schema not two schemas
  • Loading branch information
FANNG1 authored Nov 4, 2024
1 parent 240bac9 commit 452d97e
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 452d97e

Please sign in to comment.