apache/iceberg · error · UnsupportedOperationException
Cannot create namespace " + namespace + ": metadata is not s
Error message
Cannot create namespace " + namespace + ": metadata is not supported
What it means
HadoopCatalog.createNamespace throws UnsupportedOperationException when a non-empty metadata map is passed, because the filesystem-based catalog stores no namespace metadata. The namespace is a plain directory; arbitrary properties cannot be attached.
Source
Thrown at core/src/main/java/org/apache/iceberg/hadoop/HadoopCatalog.java:284
}
return fs.delete(tablePath, true /* recursive */);
}
} catch (IOException e) {
throw new RuntimeIOException(e, "Failed to delete file: %s", tablePath);
}
}
@Override
public void renameTable(TableIdentifier from, TableIdentifier to) {
throw new UnsupportedOperationException("Cannot rename Hadoop tables");
}
@Override
public void createNamespace(Namespace namespace, Map<String, String> meta) {
Preconditions.checkArgument(
!namespace.isEmpty(), "Cannot create namespace with invalid name: %s", namespace);
if (!meta.isEmpty()) {
throw new UnsupportedOperationException(
"Cannot create namespace " + namespace + ": metadata is not supported");
}
Path nsPath = new Path(warehouseLocation, SLASH.join(namespace.levels()));
if (isNamespace(nsPath)) {
throw new AlreadyExistsException("Namespace already exists: %s", namespace);
}
try {
fs.mkdirs(nsPath);
} catch (IOException e) {
throw new RuntimeIOException(e, "Create namespace failed: %s", namespace);
}
}
@OverrideView on GitHub (pinned to 86d9c8fc54)
Solutions
- Pass an empty map (Collections.emptyMap()) to createNamespace on HadoopCatalog.
- Remove namespace property-setting code paths when targeting the Hadoop catalog.
- If namespace properties are required, switch to HiveCatalog, JdbcCatalog, or RESTCatalog.
- Guard the call: only pass metadata when the catalog supports it.
Example fix
// before
catalog.createNamespace(ns, ImmutableMap.of("comment", "sales data"));
// after
if (catalog instanceof HadoopCatalog) {
catalog.createNamespace(ns, Collections.emptyMap());
} else {
catalog.createNamespace(ns, metadata);
} Defensive patterns
Strategy: validation
Validate before calling
if (meta != null && !meta.isEmpty()) { throw new IllegalArgumentException("HadoopCatalog does not support namespace metadata"); } Try / catch
try { catalog.createNamespace(ns, meta); } catch (UnsupportedOperationException e) { catalog.createNamespace(ns, Collections.emptyMap()); } Prevention
- Pass empty metadata maps to HadoopCatalog
- Branch namespace-property code on catalog type
- Prefer Hive/JDBC/REST catalogs when properties are needed
When it happens
Trigger: Calling catalog.createNamespace(namespace, meta) where meta is non-empty (e.g. porting code from HiveCatalog that sets namespace comments or properties).
Common situations: Migrating from Hive/Glue catalogs to HadoopCatalog while reusing namespace-creation code that carries properties; generic catalog tooling that always forwards a metadata map.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- %s
- Namespace does not exist: %s
- Cannot rename Hadoop tables
- Update type %s is not supported
- Can not alter the default database when the iceberg catalog
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/c2a29878400e011f.
Report an issue: GitHub.