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

  1. Use a Catalog implementation (e.g. HadoopCatalog/HiveCatalog via Catalog.buildTable) which supports sort orders, instead of the legacy Tables interface.
  2. Drop the SortOrder argument and call the older create(schema, spec, properties, identifier), then apply sort order via table.updateSortOrder() or rebuild the table.
  3. Upgrade the Tables implementation so it overrides the sort-order-aware create.
  4. 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

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


AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/d2740d5ef14f3337. Report an issue: GitHub.