{"record":{"id":"8e65e2b438ddd65f","repo":"apache/iceberg","slug":"this-getclass-getname-does-not-implement-up","errorCode":null,"errorMessage":"${this.getClass().getName()} does not implement update","messagePattern":"(.+?) does not implement update","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/source/SparkPositionDeltaWrite.java","lineNumber":609,"sourceCode":"\n    @Override\n    public void delete(InternalRow metadata, InternalRow id) throws IOException {\n      int specId = metadata.getInt(specIdOrdinal);\n      PartitionSpec spec = specs.get(specId);\n\n      InternalRow partition = metadata.getStruct(partitionOrdinal, partitionRowWrapper.size());\n      StructProjection partitionProjection = partitionProjections.get(specId);\n      partitionProjection.wrap(partitionRowWrapper.wrap(partition));\n\n      String file = id.getString(fileOrdinal);\n      long position = id.getLong(positionOrdinal);\n      positionDelete.set(file, position);\n      delegate.write(positionDelete, spec, partitionProjection);\n    }\n\n    @Override\n    public void update(InternalRow metadata, InternalRow id, InternalRow row) {\n      throw new UnsupportedOperationException(\n          this.getClass().getName() + \" does not implement update\");\n    }\n\n    @Override\n    public void insert(InternalRow row) throws IOException {\n      throw new UnsupportedOperationException(\n          this.getClass().getName() + \" does not implement insert\");\n    }\n\n    @Override\n    public WriterCommitMessage commit() throws IOException {\n      close();\n\n      DeleteWriteResult result = delegate.result();\n      return new DeltaTaskCommit(result);\n    }\n\n    @Override","sourceCodeStart":591,"sourceCodeEnd":627,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/source/SparkPositionDeltaWrite.java#L591-L627","documentation":"The position-delta writer delegates writes as delete files plus inserts; it has no path for in-place row updates. Spark's RowDataWriter update() entry point therefore throws UnsupportedOperationException identifying the concrete writer class.","triggerScenarios":"A MERGE/position-delta write plan producing an 'update' operation (metadata + id + full row) routed to this writer, e.g. Spark emitting UPDATE rows through SparkWrite's position delta path.","commonSituations":"Running MERGE WHEN MATCHED THEN UPDATE (or UPDATE table) on a table configured for copy-on-write disabled / position-delta writes where the writer does not support update ops.","solutions":["Express updates as delete+insert (this is how the writer expects them; check the Spark action generating updates).","Enable copy-on-write mode for the table so updates are supported: set write.update.mode=copy-on-write.","Upgrade Iceberg/Spark integration to a version whose delta writer supports update operations if available."],"exampleFix":"// before\nUPDATE catalog.db.t SET c = 1 WHERE id = 5 // delta writer path\n// after\nALTER TABLE catalog.db.t SET TBLPROPERTIES ('write.update.mode'='copy-on-write')","handlingStrategy":"validation","validationCode":"// ensure updates are supported for the table's write mode\nString mode = table.properties().getOrDefault(\"write.update.mode\", \"merge-on-read\");\nboolean updatesSupported = \"copy-on-write\".equals(mode);","typeGuard":null,"tryCatchPattern":"try { writer.update(meta, id, row); } catch (UnsupportedOperationException e) { /* rewrite as delete+insert */ }","preventionTips":["Set write.update.mode=copy-on-write when UPDATE/MERGE updates are required","Express updates as delete+insert in delta plans","Confirm the Spark/Iceberg integration version supports updates for your write mode"],"tags":["spark","delta-write","position-delete","unsupported-operation"],"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"}