apache/seatunnel · error · UnsupportedOperationException

catalog not implements SupportsNamespaces so can't list…

Error message

catalog not implements SupportsNamespaces so can't list databases

What it means

IcebergCatalog.listDatabases delegates to SupportsNamespaces.listNamespaces on the wrapped Iceberg catalog; if the underlying catalog does not implement SupportsNamespaces, it throws UnsupportedOperationException saying it cannot list databases.

Solutions

  1. Switch to a namespace-aware catalog (HiveCatalog, HadoopCatalog, JDBC, Nessie) for this job
  2. Avoid calling listDatabases for this catalog type; query specific namespaces/tables directly if supported
  3. Extend the custom catalog to implement SupportsNamespaces.listNamespaces

Example fix

// before
catalog { name = "custom-catalog" } // no SupportsNamespaces
// after
catalog { name = "jdbc", uri = "jdbc:metadata:..." } // supports namespaces
Defensive patterns

Strategy: type-guard

Validate before calling

if (!(icebergCatalog instanceof SupportsNamespaces)) {
  throw new IllegalStateException("Catalog cannot list databases; pick a SupportsNamespaces catalog");
}

Type guard

if (catalog instanceof SupportsNamespaces) {
    List<Namespace> namespaces = ((SupportsNamespaces) catalog).listNamespaces();
}

Try / catch

try {
  List<String> dbs = seaTunnelCatalog.listDatabases();
} catch (UnsupportedOperationException e) {
  // use known namespace list from config instead
}

Prevention

When it happens

Trigger: listDatabases is invoked (e.g. by catalog browsing, sync tools, or pre-checks) against an Iceberg catalog implementation that only implements the base Catalog interface.

Common situations: Pointing the connector at a minimal/custom catalog implementation without namespace support; running list-features tooling against a catalog type that can't enumerate namespaces.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/fc3ea316ed6bf29f. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-connectors-v2/connector-iceberg/src/main/java/org/apache/seatunnel/connectors/seatunnel/iceberg/catalog/IcebergCatalog.java:141

            return exists;
        } else {
            throw new UnsupportedOperationException(
                    "catalog not implements SupportsNamespaces so can't check database exists");
        }
    }

    @Override
    public List<String> listDatabases() throws CatalogException {
        if (catalog instanceof SupportsNamespaces) {
            List<String> databases =
                    ((SupportsNamespaces) catalog)
                            .listNamespaces().stream()
                                    .map(Namespace::toString)
                                    .collect(Collectors.toList());
            log.info("Fetched {} namespaces.", databases.size());
            return databases;
        } else {
            throw new UnsupportedOperationException(
                    "catalog not implements SupportsNamespaces so can't list databases");
        }
    }

    @Override
    public List<String> listTables(String databaseName)
            throws CatalogException, DatabaseNotExistException {
        List<String> tables =
                catalog.listTables(Namespace.of(databaseName)).stream()
                        .map(tableIdentifier -> toTablePath(tableIdentifier).getTableName())
                        .collect(Collectors.toList());
        log.info("Fetched {} tables.", tables.size());
        return tables;
    }

    @Override
    public boolean tableExists(TablePath tablePath) throws CatalogException {
        return catalog.tableExists(toIcebergTableIdentifier(tablePath));

View on GitHub (pinned to cf67b549a7)