{"record":{"id":"f38108f596c00267","repo":"apache/iceberg","slug":"operation-managesnapshots-is-not-supported-after-t","errorCode":null,"errorMessage":"Operation manageSnapshots is not supported after the table is serialized","messagePattern":"Operation manageSnapshots is not supported after the table is serialized","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/SerializableTable.java","lineNumber":427,"sourceCode":"\n  @Override\n  public UpdateStatistics updateStatistics() {\n    throw new UnsupportedOperationException(errorMsg(\"updateStatistics\"));\n  }\n\n  @Override\n  public UpdatePartitionStatistics updatePartitionStatistics() {\n    throw new UnsupportedOperationException(errorMsg(\"updatePartitionStatistics\"));\n  }\n\n  @Override\n  public ExpireSnapshots expireSnapshots() {\n    throw new UnsupportedOperationException(errorMsg(\"expireSnapshots\"));\n  }\n\n  @Override\n  public ManageSnapshots manageSnapshots() {\n    throw new UnsupportedOperationException(errorMsg(\"manageSnapshots\"));\n  }\n\n  @Override\n  public Transaction newTransaction() {\n    throw new UnsupportedOperationException(errorMsg(\"newTransaction\"));\n  }\n\n  @Override\n  public StaticTableOperations operations() {\n    return (StaticTableOperations) ((BaseTable) lazyTable()).operations();\n  }\n\n  private String errorMsg(String operation) {\n    return String.format(\"Operation %s is not supported after the table is serialized\", operation);\n  }\n\n  public static class SerializableMetadataTable extends SerializableTable {\n    private final MetadataTableType type;","sourceCodeStart":409,"sourceCodeEnd":445,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/SerializableTable.java#L409-L445","documentation":"SerializableTable is a read-only serializable copy of a table for distribution across cluster nodes; it cannot commit changes. manageSnapshots() (cherrypick/rollback of snapshots) is a mutating operation, so the implementation always throws this UnsupportedOperationException. Snapshot management must be performed on a table loaded directly from its catalog.","triggerScenarios":"Calling table.manageSnapshots() (e.g. rollback, cherrypick, createBranch) on a Table that is a SerializableTable — after Java serialization to an executor or via SerializableTable.copyOf().","commonSituations":"Executing rollback/cherrypick logic in a distributed task where the table arrived serialized inside the closure; using a deserialized table in custom engine integrations; mistakenly treating a broadcast table as a normal catalog table.","solutions":["Reload the table from its catalog (catalog.loadTable(location)) on the node that performs the snapshot operation, then call manageSnapshots().","Perform the operation in the driver where the original catalog-backed Table is available, and only ship SerializableTable for read/scan work.","Add an instanceof check before invoking snapshot-management APIs and fail fast with a clear message or route to a catalog-loaded table."],"exampleFix":"// before\ntable.manageSnapshots().rollbackTo(snapshotId); // table is SerializableTable\n\n// after\nTable fresh = catalog.loadTable(tableLocation);\nfresh.manageSnapshots().rollbackTo(snapshotId);","handlingStrategy":"type-guard","validationCode":"if (table instanceof org.apache.iceberg.SerializableTable) {\n  table = catalog.loadTable(table.location()); // reload before managing snapshots\n}","typeGuard":"boolean supportsSnapshotManagement(Table t) {\n  return !(t instanceof org.apache.iceberg.SerializableTable);\n}","tryCatchPattern":"try {\n  table.manageSnapshots().rollbackTo(snapshotId);\n} catch (UnsupportedOperationException e) {\n  catalog.loadTable(table.location()).manageSnapshots().rollbackTo(snapshotId);\n}","preventionTips":["Perform rollback/cherrypick in the driver where the table came from a Catalog.","Treat any Table that crossed a serialization boundary as read-only.","Prefer engine action APIs (e.g. Spark rollback procedures) over raw Table APIs on distributed references."],"tags":["java","unsupported-operation","serialization","snapshot-management"],"backgroundTag":"unsupported-operation","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}