apache/iceberg · error · UnsupportedOperationException

Operation updatePartitionStatistics is not supported after…

Error message

Operation updatePartitionStatistics is not supported after the table is serialized

What it means

SerializableTable carries only table metadata and FileIO for distributed reads; it cannot commit metadata because serialization drops the catalog connection. updatePartitionStatistics() is a committing operation, so SerializableTable overrides it to throw UnsupportedOperationException with this message. Partition statistics must be published through a live, catalog-backed Table.

Solutions

  1. Publish partition statistics with catalog.loadTable(id).updatePartitionStatistics()...commit()
  2. Gather stats on workers and perform the commit driver-side with the original Table
  3. Use engine-native maintenance commands instead of manual partition-stat commits on executors
  4. Add an instanceof SerializableTable check before any committing operation to fail fast

Example fix

// before
Table table = serialized;
table.updatePartitionStatistics().setPartitionStatistics(partitionStatsFile).commit();
// after
Table table = catalog.loadTable(identifier);
table.updatePartitionStatistics().setPartitionStatistics(partitionStatsFile).commit();
Defensive patterns

Strategy: try-catch

Validate before calling

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

Type guard

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

Try / catch

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

Prevention

When it happens

Trigger: Calling table.updatePartitionStatistics() on a deserialized SerializableTable inside a worker task, e.g. computing partition stats in executors and attempting to commit them there.

Common situations: Distributed partition-stats maintenance jobs; utilities that accept a generic Table and receive a SerializableTable; code refactored from driver into executor scope.

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

Appendix: source

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

  @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
  public Transaction newTransaction() {
    throw new UnsupportedOperationException(errorMsg("newTransaction"));
  }

  @Override

View on GitHub (pinned to 86d9c8fc54)