{"record":{"id":"50157dedbe2ee72e","repo":"apache/iceberg","slug":"this-getclass-getname-does-not-implement-in-50157d","errorCode":null,"errorMessage":"${this.getClass().getName()} does not implement insert","messagePattern":"(.+?) does not implement insert","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/source/SparkPositionDeltaWrite.java","lineNumber":653,"sourceCode":"      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\n    public void abort() throws IOException {\n      close();\n\n      DeleteWriteResult result = delegate.result();\n      SparkCleanupUtil.deleteTaskFiles(io, result.deleteFiles());\n    }","sourceCodeStart":635,"sourceCodeEnd":671,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/source/SparkPositionDeltaWrite.java#L635-L671","documentation":"Like update(), the insert(row) method of this position-delete delegate writer is not implemented; inserts into the data table are handled elsewhere in the delta write plan. Calling insert() throws UnsupportedOperationException identifying the concrete writer class.","triggerScenarios":"Spark delta execution invoking insert(InternalRow) on the position-delete writer produced by SparkPositionDeltaWrite instead of on the data-table writer.","commonSituations":"Custom write pipelines routing insert rows to the delete writer; misconfigured write builders assigning the wrong writer for the insert side of a MERGE WHEN NOT MATCHED branch.","solutions":["Route insert rows to the data-side BatchWrite/RowDataWriter, not the position-delete delegate","Use Iceberg's standard MERGE/append paths so Spark plans insert branches against the data writer","Check which RowDataWriter class is wired for each delta branch in custom integrations"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"if (!(writer instanceof SupportsInsert)) {\n  throw new IllegalArgumentException(\"This writer does not accept inserts\");\n}","typeGuard":"boolean acceptsInsert = !(writer instanceof PositionDeleteDelegate);","tryCatchPattern":null,"preventionTips":["Send inserts to the data-side writer only","Map each MERGE branch to the correct writer type","Review custom delta-write wiring in integrations"],"tags":["spark","merge-on-read","unsupported-operation"],"backgroundTag":"method-not-implemented","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"}