Skip to content

Commit

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

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

remove duplicate schema names after list schemas from Paimon

### Why are the changes needed?

Fix: #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 and web-flow committed Nov 4, 2024
1 parent d99c5be commit 27f15fd
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 27f15fd

Please sign in to comment.