{"record":{"id":"e6ea76947c55e09d","repo":"apache/iceberg","slug":"operation-replacesortorder-is-not-supported-after","errorCode":null,"errorMessage":"Operation replaceSortOrder is not supported after the table is serialized","messagePattern":"Operation replaceSortOrder 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":367,"sourceCode":"\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\n  public UpdateLocation updateLocation() {\n    throw new UnsupportedOperationException(errorMsg(\"updateLocation\"));\n  }\n\n  @Override\n  public AppendFiles newAppend() {\n    throw new UnsupportedOperationException(errorMsg(\"newAppend\"));\n  }\n\n  @Override\n  public RewriteFiles newRewrite() {\n    throw new UnsupportedOperationException(errorMsg(\"newRewrite\"));\n  }\n\n  @Override","sourceCodeStart":349,"sourceCodeEnd":385,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/SerializableTable.java#L349-L385","documentation":"SerializableTable guard: replaceSortOrder() is a metadata mutation, and deserialized table handles on executors only support reads. The error names the operation so callers know to perform sort-order replacement on the driver-side Table instance.","triggerScenarios":"Calling replaceSortOrder() on a SerializableTable instance, typically from distributed or wrapped table contexts.","commonSituations":"Maintenance jobs re-sorting tables using a table handle that was serialized and shipped to workers.","solutions":["Run sort order replacement on the driver with a live table from the catalog","Serialize only data-scanning work; keep all writes on the driver","Use catalog.loadTable(identifier) wherever SortOrder updates are required"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (table instanceof SerializableTable) { throw new UnsupportedOperationException(\"Sort order updates require a live catalog table\"); }","typeGuard":"boolean canWrite = !(table instanceof SerializableTable);","tryCatchPattern":"try { table.replaceSortOrder().commit(); } catch (UnsupportedOperationException e) { catalog.loadTable(id).replaceSortOrder().commit(); }","preventionTips":["Run sort order maintenance on the driver","Keep all metadata writes off serialized table instances"],"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"}