prestodb/presto · error · PrestoException

NOT_SUPPORTED

NOT_SUPPORTED

Error message

Iceberg %s catalog does not support rename namespace

What it means

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.

Source

Thrown at presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergNativeMetadata.java:267

    }

    @Override
    public void dropSchema(ConnectorSession session, String schemaName)
    {
        shouldRunInAutoCommitTransaction("DROP SCHEMA");
        try {
            catalogFactory.getNamespaces(session).dropNamespace(toIcebergNamespace(Optional.of(schemaName), catalogFactory.isNestedNamespaceEnabled()));
        }
        catch (NamespaceNotEmptyException e) {
            throw new PrestoException(SCHEMA_NOT_EMPTY, "Schema not empty: " + schemaName);
        }
    }

    @Override
    public void renameSchema(ConnectorSession session, String source, String target)
    {
        shouldRunInAutoCommitTransaction("RENAME SCHEMA");
        throw new PrestoException(NOT_SUPPORTED, format("Iceberg %s catalog does not support rename namespace", catalogType.name()));
    }

    @Override
    public void createView(ConnectorSession session, ConnectorTableMetadata viewMetadata, String viewData, boolean replace)
    {
        shouldRunInAutoCommitTransaction("CREATE VIEW");
        validateViewDefinitionForBranches(viewData, "CREATE VIEW");
        Catalog catalog = catalogFactory.getCatalog(session);
        if (!(catalog instanceof ViewCatalog)) {
            throw new PrestoException(NOT_SUPPORTED, "This connector does not support creating views");
        }
        Schema schema = toIcebergSchema(viewMetadata.getColumns());
        ViewBuilder viewBuilder = ((ViewCatalog) catalog).buildView(toIcebergTableIdentifier(viewMetadata.getTable(), catalogFactory.isNestedNamespaceEnabled()))
                .withSchema(schema)
                .withDefaultNamespace(toIcebergNamespace(Optional.ofNullable(viewMetadata.getTable().getSchemaName()), catalogFactory.isNestedNamespaceEnabled()))
                .withQuery(VIEW_DIALECT, viewData)
                .withProperties(createIcebergViewProperties(session, nodeVersion.toString()));
        if (replace) {

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Create the target schema, copy/move tables (CREATE TABLE ... AS or CTAS per table), then drop the old schema.
  2. Rename the namespace directly in the catalog backend if its tooling supports it, then refresh Presto metadata.
  3. Avoid ALTER SCHEMA RENAME in code paths targeting Iceberg native catalogs; feature-detect support first.
  4. Track/request connector support for namespace rename in the Presto Iceberg connector.

Example fix

// before
ALTER SCHEMA old_schema RENAME TO new_schema;
// after
CREATE SCHEMA new_schema;
-- for each table:
CREATE TABLE new_schema.t AS SELECT * FROM old_schema.t;
DROP TABLE old_schema.t;
DROP SCHEMA old_schema;
Defensive patterns

Strategy: validation

Validate before calling

// Java: never issue rename for Iceberg native catalogs; detect and route around
if (metadata instanceof IcebergNativeMetadata) {
    throw new UnsupportedOperationException("ALTER SCHEMA RENAME is not supported for Iceberg native catalogs; use create+copy+drop");
}

Type guard

boolean supportsRenameSchema(ConnectorMetadata metadata) {
    return !(metadata instanceof IcebergNativeMetadata);
}

Try / catch

try {
    metadata.renameSchema(session, source, target);
} catch (PrestoException e) {
    if (e.getErrorCode().getCode() == StandardErrorCode.NOT_SUPPORTED.getCode()) {
        // fallback: create target schema, copy tables, drop source
    } else throw e;
}

Prevention

When it happens

Trigger: Executing ALTER SCHEMA source RENAME TO target against an Iceberg native catalog (any catalogType) — the method always throws regardless of catalog type.

Common situations: Migrating schema naming conventions via rename; tooling that assumes all connectors support ALTER SCHEMA ... RENAME; automated schema governance scripts applying uniform DDL across connectors.

Understand the failure class

Background: Presto NOT_SUPPORTED error: what "not supported" means and how to fix it — this error's family across 3 libraries.

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/6b8909bc950484b4. Report an issue: GitHub.