{"record":{"id":"6b8909bc950484b4","repo":"prestodb/presto","slug":"not-supported-6b8909","errorCode":"NOT_SUPPORTED","errorMessage":"Iceberg %s catalog does not support rename namespace","messagePattern":"Iceberg (.+?) catalog does not support rename namespace","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergNativeMetadata.java","lineNumber":267,"sourceCode":"    }\n\n    @Override\n    public void dropSchema(ConnectorSession session, String schemaName)\n    {\n        shouldRunInAutoCommitTransaction(\"DROP SCHEMA\");\n        try {\n            catalogFactory.getNamespaces(session).dropNamespace(toIcebergNamespace(Optional.of(schemaName), catalogFactory.isNestedNamespaceEnabled()));\n        }\n        catch (NamespaceNotEmptyException e) {\n            throw new PrestoException(SCHEMA_NOT_EMPTY, \"Schema not empty: \" + schemaName);\n        }\n    }\n\n    @Override\n    public void renameSchema(ConnectorSession session, String source, String target)\n    {\n        shouldRunInAutoCommitTransaction(\"RENAME SCHEMA\");\n        throw new PrestoException(NOT_SUPPORTED, format(\"Iceberg %s catalog does not support rename namespace\", catalogType.name()));\n    }\n\n    @Override\n    public void createView(ConnectorSession session, ConnectorTableMetadata viewMetadata, String viewData, boolean replace)\n    {\n        shouldRunInAutoCommitTransaction(\"CREATE VIEW\");\n        validateViewDefinitionForBranches(viewData, \"CREATE VIEW\");\n        Catalog catalog = catalogFactory.getCatalog(session);\n        if (!(catalog instanceof ViewCatalog)) {\n            throw new PrestoException(NOT_SUPPORTED, \"This connector does not support creating views\");\n        }\n        Schema schema = toIcebergSchema(viewMetadata.getColumns());\n        ViewBuilder viewBuilder = ((ViewCatalog) catalog).buildView(toIcebergTableIdentifier(viewMetadata.getTable(), catalogFactory.isNestedNamespaceEnabled()))\n                .withSchema(schema)\n                .withDefaultNamespace(toIcebergNamespace(Optional.ofNullable(viewMetadata.getTable().getSchemaName()), catalogFactory.isNestedNamespaceEnabled()))\n                .withQuery(VIEW_DIALECT, viewData)\n                .withProperties(createIcebergViewProperties(session, nodeVersion.toString()));\n        if (replace) {","sourceCodeStart":249,"sourceCodeEnd":285,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergNativeMetadata.java#L249-L285","documentation":"Iceberg native catalogs in this Presto connector do not implement renaming namespaces. renameSchema unconditionally throws NOT_SUPPORTED after checking the auto-commit transaction requirement, because the underlying Iceberg catalog API cannot rename a namespace in place.","triggerScenarios":"Executing ALTER SCHEMA source RENAME TO target against an Iceberg native catalog (any catalogType) — the method always throws regardless of catalog type.","commonSituations":"Migrating schema naming conventions via rename; tooling that assumes all connectors support ALTER SCHEMA ... RENAME; automated schema governance scripts applying uniform DDL across connectors.","solutions":["Create the target schema, copy/move tables (CREATE TABLE ... AS or CTAS per table), then drop the old schema.","Rename the namespace directly in the catalog backend if its tooling supports it, then refresh Presto metadata.","Avoid ALTER SCHEMA RENAME in code paths targeting Iceberg native catalogs; feature-detect support first.","Track/request connector support for namespace rename in the Presto Iceberg connector."],"exampleFix":"// before\nALTER SCHEMA old_schema RENAME TO new_schema;\n// after\nCREATE SCHEMA new_schema;\n-- for each table:\nCREATE TABLE new_schema.t AS SELECT * FROM old_schema.t;\nDROP TABLE old_schema.t;\nDROP SCHEMA old_schema;","handlingStrategy":"validation","validationCode":"// Java: never issue rename for Iceberg native catalogs; detect and route around\nif (metadata instanceof IcebergNativeMetadata) {\n    throw new UnsupportedOperationException(\"ALTER SCHEMA RENAME is not supported for Iceberg native catalogs; use create+copy+drop\");\n}","typeGuard":"boolean supportsRenameSchema(ConnectorMetadata metadata) {\n    return !(metadata instanceof IcebergNativeMetadata);\n}","tryCatchPattern":"try {\n    metadata.renameSchema(session, source, target);\n} catch (PrestoException e) {\n    if (e.getErrorCode().getCode() == StandardErrorCode.NOT_SUPPORTED.getCode()) {\n        // fallback: create target schema, copy tables, drop source\n    } else throw e;\n}","preventionTips":["Exclude ALTER SCHEMA RENAME from any DDL runner targeting Iceberg native catalogs.","Implement a create/copy/drop fallback in migration tooling.","Rename namespaces in the catalog backend tooling when it supports it.","Check connector docs for the supported DDL matrix per catalog type."],"tags":["presto","iceberg","rename-schema","unsupported-operation"],"backgroundTag":"rename-namespace-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"}