{"record":{"id":"fc3ea316ed6bf29f","repo":"apache/seatunnel","slug":"catalog-not-implements-supportsnamespaces-so-can-t-fc3ea3","errorCode":null,"errorMessage":"catalog not implements SupportsNamespaces so can't list databases","messagePattern":"catalog not implements SupportsNamespaces so can't list databases","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-iceberg/src/main/java/org/apache/seatunnel/connectors/seatunnel/iceberg/catalog/IcebergCatalog.java","lineNumber":141,"sourceCode":"            return exists;\n        } else {\n            throw new UnsupportedOperationException(\n                    \"catalog not implements SupportsNamespaces so can't check database exists\");\n        }\n    }\n\n    @Override\n    public List<String> listDatabases() throws CatalogException {\n        if (catalog instanceof SupportsNamespaces) {\n            List<String> databases =\n                    ((SupportsNamespaces) catalog)\n                            .listNamespaces().stream()\n                                    .map(Namespace::toString)\n                                    .collect(Collectors.toList());\n            log.info(\"Fetched {} namespaces.\", databases.size());\n            return databases;\n        } else {\n            throw new UnsupportedOperationException(\n                    \"catalog not implements SupportsNamespaces so can't list databases\");\n        }\n    }\n\n    @Override\n    public List<String> listTables(String databaseName)\n            throws CatalogException, DatabaseNotExistException {\n        List<String> tables =\n                catalog.listTables(Namespace.of(databaseName)).stream()\n                        .map(tableIdentifier -> toTablePath(tableIdentifier).getTableName())\n                        .collect(Collectors.toList());\n        log.info(\"Fetched {} tables.\", tables.size());\n        return tables;\n    }\n\n    @Override\n    public boolean tableExists(TablePath tablePath) throws CatalogException {\n        return catalog.tableExists(toIcebergTableIdentifier(tablePath));","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-iceberg/src/main/java/org/apache/seatunnel/connectors/seatunnel/iceberg/catalog/IcebergCatalog.java#L123-L159","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Switch to a namespace-aware catalog (HiveCatalog, HadoopCatalog, JDBC, Nessie) for this job","Avoid calling listDatabases for this catalog type; query specific namespaces/tables directly if supported","Extend the custom catalog to implement SupportsNamespaces.listNamespaces"],"exampleFix":"// before\ncatalog { name = \"custom-catalog\" } // no SupportsNamespaces\n// after\ncatalog { name = \"jdbc\", uri = \"jdbc:metadata:...\" } // supports namespaces","handlingStrategy":"type-guard","validationCode":"if (!(icebergCatalog instanceof SupportsNamespaces)) {\n  throw new IllegalStateException(\"Catalog cannot list databases; pick a SupportsNamespaces catalog\");\n}","typeGuard":"if (catalog instanceof SupportsNamespaces) {\n    List<Namespace> namespaces = ((SupportsNamespaces) catalog).listNamespaces();\n}","tryCatchPattern":"try {\n  List<String> dbs = seaTunnelCatalog.listDatabases();\n} catch (UnsupportedOperationException e) {\n  // use known namespace list from config instead\n}","preventionTips":["Use Hive/Hadoop/JDBC/Nessie catalogs when database enumeration is required","Guard with instanceof SupportsNamespaces before listDatabases","Keep a configured fallback list of namespaces for limited catalogs"],"tags":["iceberg","catalog","namespaces","unsupported"],"backgroundTag":"unsupported-operation","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}