{"record":{"id":"1a341df75a3011e6","repo":"apache/iceberg","slug":"operation-rewritemanifests-is-not-supported-after","errorCode":null,"errorMessage":"Operation rewriteManifests is not supported after the table is serialized","messagePattern":"Operation rewriteManifests 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":387,"sourceCode":"\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\n  public RewriteManifests rewriteManifests() {\n    throw new UnsupportedOperationException(errorMsg(\"rewriteManifests\"));\n  }\n\n  @Override\n  public OverwriteFiles newOverwrite() {\n    throw new UnsupportedOperationException(errorMsg(\"newOverwrite\"));\n  }\n\n  @Override\n  public RowDelta newRowDelta() {\n    throw new UnsupportedOperationException(errorMsg(\"newRowDelta\"));\n  }\n\n  @Override\n  public ReplacePartitions newReplacePartitions() {\n    throw new UnsupportedOperationException(errorMsg(\"newReplacePartitions\"));\n  }\n\n  @Override","sourceCodeStart":369,"sourceCodeEnd":405,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/SerializableTable.java#L369-L405","documentation":"SerializableTable wraps table metadata and FileIO so a table can be used for reads in distributed tasks, but it cannot commit metadata changes because it has no catalog connection. rewriteManifests() is a metadata-mutating operation, so it is overridden to throw UnsupportedOperationException with this message.","triggerScenarios":"Calling table.rewriteManifests() on a deserialized SerializableTable inside a worker task, e.g. building a custom manifest compaction job.","commonSituations":"Distributed manifest compaction implemented by shipping the Table across the wire; refactoring driver code into executors; helper utilities that accept Table and are fed a SerializableTable.","solutions":["Use catalog.loadTable(identifier).rewriteManifests() so commits go through the catalog","Run manifest rewriting on the driver where the live Table is available","Return rewrite results from workers and apply the commit driver-side via the original table","Add an explicit check (table instanceof SerializableTable) that fails fast with a clearer message"],"exampleFix":"// before\nTable table = deserializedTable; // SerializableTable\ntable.rewriteManifests().execute();\n// after\nTable table = catalog.loadTable(identifier);\ntable.rewriteManifests().execute();","handlingStrategy":"try-catch","validationCode":"if (table instanceof org.apache.iceberg.SerializableTable) {\n  throw new IllegalStateException(\"rewriteManifests() requires a catalog-backed Table\");\n}","typeGuard":"boolean canCommit = !(table instanceof org.apache.iceberg.SerializableTable);","tryCatchPattern":"try {\n  table.rewriteManifests().execute();\n} catch (UnsupportedOperationException e) {\n  if (e.getMessage().contains(\"not supported after the table is serialized\")) {\n    catalog.loadTable(identifier).rewriteManifests().execute();\n  } else { throw e; }\n}","preventionTips":["Keep manifest rewrites on the catalog-connected node","Pass table identifiers across the wire, never serialized Table instances for writes","Validate table type at helper-method entry points","Treat SerializableTable strictly as a read-only view"],"tags":["java","iceberg","unsupported-operation","serialization"],"backgroundTag":"unsupported-operation","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"}