apache/iceberg · error · UnsupportedOperationException

Operation updateStatistics is not supported after the table…

Error message

Operation updateStatistics is not supported after the table is serialized

What it means

SerializableTable is the serialized, read-only representation of a table used on distributed workers; it has no catalog connection, so any metadata commit is impossible. updateStatistics() would write new statistics files and commit table metadata, hence it throws UnsupportedOperationException with this message.

Solutions

  1. Commit statistics via the catalog-backed table: catalog.loadTable(id).updateStatistics()...commit()
  2. Collect statistics on workers, return them, and commit from the driver using the live Table
  3. Use engine-native ANALYZE/statistics tooling instead of manual commits in executors
  4. Check for SerializableTable instances before calling metadata-mutating methods

Example fix

// before
Table table = serializedTable;
table.updateStatistics().setStatisticsSnapshot(statisticsFile).commit();
// after
Table table = catalog.loadTable(identifier);
table.updateStatistics().setStatisticsSnapshot(statisticsFile).commit();
Defensive patterns

Strategy: try-catch

Validate before calling

if (table instanceof org.apache.iceberg.SerializableTable) {
  throw new IllegalStateException("updateStatistics() requires a catalog-backed Table");
}

Type guard

boolean canUpdateStats = !(table instanceof org.apache.iceberg.SerializableTable);

Try / catch

try {
  table.updateStatistics().setStatisticsSnapshot(sf).commit();
} catch (UnsupportedOperationException e) {
  if (e.getMessage().contains("not supported after the table is serialized")) {
    catalog.loadTable(identifier).updateStatistics().setStatisticsSnapshot(sf).commit();
  } else { throw e; }
}

Prevention

When it happens

Trigger: Calling table.updateStatistics() on a SerializableTable produced by SerializableTable.wrap(...) and deserialized in a task, e.g. an analytics job computing statistics on workers and trying to commit them directly.

Common situations: Statistics collection jobs that serialize the Table and attempt to publish stats from executors; maintenance utilities sharing Table objects between driver and workers.

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/933c8d716ba56e1a. Report an issue: GitHub.

Appendix: source

Thrown at core/src/main/java/org/apache/iceberg/SerializableTable.java:412

  @Override
  public RowDelta newRowDelta() {
    throw new UnsupportedOperationException(errorMsg("newRowDelta"));
  }

  @Override
  public ReplacePartitions newReplacePartitions() {
    throw new UnsupportedOperationException(errorMsg("newReplacePartitions"));
  }

  @Override
  public DeleteFiles newDelete() {
    throw new UnsupportedOperationException(errorMsg("newDelete"));
  }

  @Override
  public UpdateStatistics updateStatistics() {
    throw new UnsupportedOperationException(errorMsg("updateStatistics"));
  }

  @Override
  public UpdatePartitionStatistics updatePartitionStatistics() {
    throw new UnsupportedOperationException(errorMsg("updatePartitionStatistics"));
  }

  @Override
  public ExpireSnapshots expireSnapshots() {
    throw new UnsupportedOperationException(errorMsg("expireSnapshots"));
  }

  @Override
  public ManageSnapshots manageSnapshots() {
    throw new UnsupportedOperationException(errorMsg("manageSnapshots"));
  }

  @Override

View on GitHub (pinned to 86d9c8fc54)