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
- Commit statistics via the catalog-backed table: catalog.loadTable(id).updateStatistics()...commit()
- Collect statistics on workers, return them, and commit from the driver using the live Table
- Use engine-native ANALYZE/statistics tooling instead of manual commits in executors
- 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
- Collect stats on workers, commit stats on the driver
- Only call metadata-mutating methods on Tables loaded from a Catalog
- Avoid shipping Table objects into executor code at all
- Add explicit type checks in maintenance utilities
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
- Operation newAppend is not supported after the table is…
- Operation newDelete is not supported after the table is…
- Operation newOverwrite is not supported after the table is…
- Operation newReplacePartitions is not supported after the…
- Operation newRewrite is not supported after the table is…
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"));
}
@OverrideView on GitHub (pinned to 86d9c8fc54)