{"record":{"id":"8d1670e0883cd463","repo":"apache/iceberg","slug":"operation-newoverwrite-is-not-supported-after-the","errorCode":null,"errorMessage":"Operation newOverwrite is not supported after the table is serialized","messagePattern":"Operation newOverwrite 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":392,"sourceCode":"\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\n  public DeleteFiles newDelete() {\n    throw new UnsupportedOperationException(errorMsg(\"newDelete\"));\n  }\n\n  @Override","sourceCodeStart":374,"sourceCodeEnd":410,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/SerializableTable.java#L374-L410","documentation":"SerializableTable is the serialized form of an Iceberg table used for read-only work on distributed workers; it cannot perform metadata commits because it lost the catalog connection during serialization. newOverwrite() produces a commit, so it throws UnsupportedOperationException with this message by design to avoid silently dropped overwrites.","triggerScenarios":"Calling table.newOverwrite() on a SerializableTable obtained from deserialization in an executor task (e.g. custom overwrite logic inside Spark/Flink workers).","commonSituations":"Custom overwrite jobs that pass a serialized Table into workers; streaming upsert code that overwrites files from executor context; reusing driver-side helper classes with a serialized table instance.","solutions":["Load the live table from the catalog on the node performing the overwrite: catalog.loadTable(id).newOverwrite()...commit()","Perform overwrite/commit on the driver and only pass data (not the Table) to workers","Use the engine's native overwrite write path (Spark/Flink sink with overwrite mode)","Fail fast with an instanceof SerializableTable check before attempting overwrite operations"],"exampleFix":"// before\nTable table = serializedTable;\ntable.newOverwrite().overwriteByRowFilter(expr, dataFile).commit();\n// after\nTable table = catalog.loadTable(identifier);\ntable.newOverwrite().overwriteByRowFilter(expr, dataFile).commit();","handlingStrategy":"try-catch","validationCode":"if (table instanceof org.apache.iceberg.SerializableTable) {\n  throw new IllegalStateException(\"newOverwrite() requires a catalog-backed Table\");\n}","typeGuard":"boolean overwritable = !(table instanceof org.apache.iceberg.SerializableTable);","tryCatchPattern":"try {\n  table.newOverwrite().overwriteByRowFilter(expr, file).commit();\n} catch (UnsupportedOperationException e) {\n  if (e.getMessage().contains(\"not supported after the table is serialized\")) {\n    catalog.loadTable(identifier).newOverwrite().overwriteByRowFilter(expr, file).commit();\n  } else { throw e; }\n}","preventionTips":["Use engine-native overwrite sinks in distributed jobs","Commit overwrites only from catalog-backed Tables","Pass data files between driver and workers, not the Table itself","Add instanceof SerializableTable guards in generic Table-accepting APIs"],"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"}