{"record":{"id":"5e4c2b23d97d4653","repo":"apache/iceberg","slug":"operation-updateschema-is-not-supported-after-the","errorCode":null,"errorMessage":"Operation updateSchema is not supported after the table is serialized","messagePattern":"Operation updateSchema 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":352,"sourceCode":"\n  @Override\n  public Snapshot snapshot(long snapshotId) {\n    return lazyTable().snapshot(snapshotId);\n  }\n\n  @Override\n  public Iterable<Snapshot> snapshots() {\n    return lazyTable().snapshots();\n  }\n\n  @Override\n  public List<HistoryEntry> history() {\n    return lazyTable().history();\n  }\n\n  @Override\n  public UpdateSchema updateSchema() {\n    throw new UnsupportedOperationException(errorMsg(\"updateSchema\"));\n  }\n\n  @Override\n  public UpdatePartitionSpec updateSpec() {\n    throw new UnsupportedOperationException(errorMsg(\"updateSpec\"));\n  }\n\n  @Override\n  public UpdateProperties updateProperties() {\n    throw new UnsupportedOperationException(errorMsg(\"updateProperties\"));\n  }\n\n  @Override\n  public ReplaceSortOrder replaceSortOrder() {\n    throw new UnsupportedOperationException(errorMsg(\"replaceSortOrder\"));\n  }\n\n  @Override","sourceCodeStart":334,"sourceCodeEnd":370,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/SerializableTable.java#L334-L370","documentation":"Schema evolution is a write operation requiring live TableOperations; SerializableTable only supports reads. updateSchema() throws UnsupportedOperationException with errorMsg(\"updateSchema\") indicating the operation is unavailable after serialization.","triggerScenarios":"Calling updateSchema() on a Table reference that is actually a SerializableTable (e.g., inside an executor task or after SerializableTable.of()).","commonSituations":"Generic code that accepts a Table and tries to evolve the schema; passing serialized tables into frameworks that perform schema updates.","solutions":["Pass the original catalog-loaded Table (or the Catalog itself) to code that performs schema updates","Perform schema updates on the driver with a live table","Check for the SerializableTable wrapper before attempting write operations"],"exampleFix":"// before\nTable t = SerializableTable.of(table);\nt.updateSchema().addColumn(\"x\", Types.IntegerType.get()).commit();\n// after\ntable.updateSchema().addColumn(\"x\", Types.IntegerType.get()).commit();","handlingStrategy":"validation","validationCode":"if (table instanceof SerializableTable) { throw new UnsupportedOperationException(\"Schema updates require a live catalog table\"); }","typeGuard":"boolean canWrite = !(table instanceof SerializableTable);","tryCatchPattern":"try { table.updateSchema().commit(); } catch (UnsupportedOperationException e) { catalog.loadTable(id).updateSchema().commit(); }","preventionTips":["Perform all schema evolution on the driver with a live table","Pass Catalog + identifier, not serialized tables, to write paths","Document that SerializableTable is read-only"],"tags":["iceberg","serialization","read-only"],"backgroundTag":"operation-not-supported","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}