apache/iceberg · error · UnsupportedOperationException
this.getClass().getName() + " does not implement create with
Error message
this.getClass().getName() + " does not implement create with a sort order"
What it means
The default Tables.create(Schema, PartitionSpec, SortOrder, Map, String) throws UnsupportedOperationException because the Tables abstraction predates sort orders; only Tables implementations that support sort orders override this five-argument create. The message names the concrete Tables class that lacks support.
Source
Thrown at api/src/main/java/org/apache/iceberg/Tables.java:50
return create(schema, PartitionSpec.unpartitioned(), ImmutableMap.of(), tableIdentifier);
}
default Table create(Schema schema, PartitionSpec spec, String tableIdentifier) {
return create(schema, spec, ImmutableMap.of(), tableIdentifier);
}
default Table create(
Schema schema, PartitionSpec spec, Map<String, String> properties, String tableIdentifier) {
return create(schema, spec, SortOrder.unsorted(), properties, tableIdentifier);
}
default Table create(
Schema schema,
PartitionSpec spec,
SortOrder order,
Map<String, String> properties,
String tableIdentifier) {
throw new UnsupportedOperationException(
this.getClass().getName() + " does not implement create with a sort order");
}
Table load(String tableIdentifier);
boolean exists(String tableIdentifier);
}
View on GitHub (pinned to 86d9c8fc54)
Solutions
- Use a Catalog implementation (e.g. HadoopCatalog/HiveCatalog via Catalog.buildTable) which supports sort orders, instead of the legacy Tables interface.
- Drop the SortOrder argument and call the older create(schema, spec, properties, identifier), then apply sort order via table.updateSortOrder() or rebuild the table.
- Upgrade the Tables implementation so it overrides the sort-order-aware create.
- Catch UnsupportedOperationException and fall back to the unsorted create path.
Example fix
// before
Table table = tables.create(schema, spec, sortOrder, props, ident);
// after
Catalog catalog = ...; // a real Catalog implementation
Table table = catalog
.buildTable(TableIdentifier.parse(ident), schema)
.withPartitionSpec(spec)
.withSortOrder(sortOrder)
.withProperties(props)
.create(); Defensive patterns
Strategy: fallback
Validate before calling
// ensure the Tables implementation supports sort orders, or use Catalog
boolean supportsSortOrderCreate = !(tables instanceof org.apache.iceberg.hadoop.HadoopTables);
if (!supportsSortOrderCreate) { useCatalogBuildTable(); } Type guard
Table createWithOrder(Tables tables, Schema schema, PartitionSpec spec,
SortOrder order, Map<String, String> props, String ident) {
try {
return tables.create(schema, spec, order, props, ident);
} catch (UnsupportedOperationException e) {
return tables.create(schema, spec, props, ident); // unsorted fallback
}
} Try / catch
Table t;
try {
t = tables.create(schema, spec, order, props, ident);
} catch (UnsupportedOperationException e) {
t = catalog.buildTable(TableIdentifier.parse(ident), schema)
.withPartitionSpec(spec).withSortOrder(order).withProperties(props).create();
} Prevention
- Prefer the Catalog.buildTable(...) API for new table creation — it supports sort orders everywhere
- Check whether your Tables implementation (e.g. HadoopTables) overrides the sort-order-aware create
- Only pass a SortOrder when the backend was verified to support it
When it happens
Trigger: Calling tables.create(schema, spec, sortOrder, properties, identifier) on a Tables implementation (e.g. HadoopTables or custom implementations) that only overrides the older four-argument create without a SortOrder.
Common situations: Creating tables with an explicit sort order via HadoopTables or a custom Tables implementation; utility code that passes a SortOrder unconditionally even when the target catalog backend doesn't support it.
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
- Cannot update the sort order of a %s table
- SnowflakeCatalog does not currently support defaultWarehouse
- %s doesn't implement copyWithStats
- %s doesn't implement validateFilesExist
- Can't retrieve values from an empty struct
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/d2740d5ef14f3337.
Report an issue: GitHub.