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
- 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.
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
- 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.
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
- NOT_SUPPORTED
- SingleMapBlock does not support appendNull()
- SingleRowBlock does not support appendNull()
- getObjectValue is not supported for TIMESTAMP(
- toEpochMillis is not supported for TIMESTAMP(
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/6b8909bc950484b4.
Report an issue: GitHub.