{"record":{"id":"697b4bf8dc6c6545","repo":"prestodb/presto","slug":"not-supported-697b4b","errorCode":"NOT_SUPPORTED","errorMessage":"Iceberg catalog of type  does not support namespace operations","messagePattern":"Iceberg catalog of type  does not support namespace operations","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergNativeCatalogFactory.java","lineNumber":109,"sourceCode":"        catch (ExecutionException | UncheckedExecutionException e) {\n            throwIfInstanceOf(e.getCause(), PrestoException.class);\n            throwIfUnchecked(e);\n            throw new UncheckedExecutionException(e);\n        }\n    }\n\n    public String getCatalogWarehouseDataDir()\n    {\n        return this.catalogWarehouseDataDir;\n    }\n\n    public SupportsNamespaces getNamespaces(ConnectorSession session)\n    {\n        Catalog catalog = getCatalog(session);\n        if (catalog instanceof SupportsNamespaces) {\n            return (SupportsNamespaces) catalog;\n        }\n        throw new PrestoException(NOT_SUPPORTED, \"Iceberg catalog of type \" + catalogType + \" does not support namespace operations\");\n    }\n\n    public boolean isNestedNamespaceEnabled()\n    {\n        return false;\n    }\n\n    protected String getCacheKey(ConnectorSession session)\n    {\n        StringBuilder sb = new StringBuilder();\n        sb.append(catalogName);\n        getCatalogCacheKey(session).ifPresent(sb::append);\n        return sb.toString();\n    }\n\n    protected Optional<String> getCatalogCacheKey(ConnectorSession session)\n    {\n        return Optional.empty();","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergNativeCatalogFactory.java#L91-L127","documentation":"Thrown by IcebergNativeCatalogFactory.getNamespaces when the underlying Iceberg catalog instance does not implement the SupportsNamespaces interface. Only certain catalog types (e.g. JDBC, Hive-metastore-like, REST) support namespace (schema/database) operations; others (e.g. Hadoop-based or memory catalogs) do not, so namespace APIs are unavailable.","triggerScenarios":"Executing any namespace operation (CREATE SCHEMA, DROP SCHEMA, LIST SCHEMAS, renameSchema, etc.) against an Iceberg native catalog whose Catalog object is not an instance of SupportsNamespaces; getNamespaces is called and the instanceof check fails.","commonSituations":"Configuring an Iceberg catalog type (e.g. a Hadoop catalog or one lacking namespace support in ice-nano/JDBC wiring) and then running schema DDL; switching catalog type in properties without revisiting schema-management code; tooling that assumes every catalog supports namespaces.","solutions":["Switch ice.catalog.type (iceberg.catalog.type) to a catalog implementation that supports namespaces, e.g. JDBC or REST with SupportsNamespaces.","Move schema management to the catalog backend directly (create the namespace in the catalog's own tooling) instead of through Presto.","Verify the configured catalog class implements org.apache.iceberg.SupportsNamespaces before issuing schema DDL.","If only table operations are needed, avoid schema-level statements entirely."],"exampleFix":"// before (properties)\niceberg.catalog.type=hadoop\n// after\niceberg.catalog.type=jdbc","handlingStrategy":"type-guard","validationCode":"// Java: check namespace support before schema DDL\nCatalog catalog = catalogFactory.getCatalog(session);\nif (!(catalog instanceof SupportsNamespaces)) {\n    throw new IllegalStateException(\"Configured catalog does not support namespace operations\");\n}","typeGuard":"boolean supportsNamespaceOps(Catalog catalog) {\n    return catalog instanceof SupportsNamespaces;\n}","tryCatchPattern":"try {\n    metadata.dropSchema(session, schemaName);\n} catch (PrestoException e) {\n    if (e.getErrorCode().getCode() == StandardErrorCode.NOT_SUPPORTED.getCode()) {\n        // manage namespace directly in the catalog backend\n    } else throw e;\n}","preventionTips":["Confirm iceberg.catalog.type maps to a SupportsNamespaces implementation before enabling schema DDL features.","Feature-detect namespace support in tooling before issuing CREATE/DROP SCHEMA.","Manage namespaces for unsupported catalog types in the catalog's own tooling.","Test catalog configuration in a staging environment with a schema DDL smoke test."],"tags":["presto","iceberg","namespace","unsupported-operation"],"backgroundTag":"namespace-operations-not-supported","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}