{"record":{"id":"2ae8b31f9de93f06","repo":"apache/iceberg","slug":"operation-newdelete-is-not-supported-after-the-tab","errorCode":null,"errorMessage":"Operation newDelete is not supported after the table is serialized","messagePattern":"Operation newDelete 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":407,"sourceCode":"\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\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","sourceCodeStart":389,"sourceCodeEnd":425,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/SerializableTable.java#L389-L425","documentation":"SerializableTable exists so an Iceberg table can be serialized to distributed workers for reading; it cannot commit because it holds no catalog reference. newDelete() starts a DeleteFiles commit, so it is overridden to throw UnsupportedOperationException with this message, preventing deletes that would silently never be committed.","triggerScenarios":"Calling table.newDelete() on a deserialized SerializableTable inside a worker task, e.g. row-level delete logic distributed to executors.","commonSituations":"Custom delete jobs passing a serialized Table to workers; copy-on-write delete helpers built from SerializableTable; refactorings that moved driver-side commit code into executor lambdas.","solutions":["Delete via a catalog-backed table: catalog.loadTable(id).newDelete()...commit()","Run delete commits on the driver; keep executor code limited to reading/producing files","Use engine-native delete procedures (e.g. Spark DELETE statement on an Iceberg table)","Guard with table instanceof SerializableTable before initiating deletes"],"exampleFix":"// before\nTable table = serialized;\ntable.newDelete().deleteFromRowFilter(expr).commit();\n// after\nTable table = catalog.loadTable(identifier);\ntable.newDelete().deleteFromRowFilter(expr).commit();","handlingStrategy":"try-catch","validationCode":"if (table instanceof org.apache.iceberg.SerializableTable) {\n  throw new IllegalStateException(\"newDelete() requires a catalog-backed Table\");\n}","typeGuard":"boolean canDelete = !(table instanceof org.apache.iceberg.SerializableTable);","tryCatchPattern":"try {\n  table.newDelete().deleteFromRowFilter(expr).commit();\n} catch (UnsupportedOperationException e) {\n  if (e.getMessage().contains(\"not supported after the table is serialized\")) {\n    catalog.loadTable(identifier).newDelete().deleteFromRowFilter(expr).commit();\n  } else { throw e; }\n}","preventionTips":["Issue deletes from the driver or another catalog-connected context","Use SQL DELETE via the engine integration for distributed deletes","Never serialize a Table for jobs that will commit","Validate table type early in delete-utility code"],"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-23T08:17:48.524Z"}