{"record":{"id":"4ff89ea0a0731dc9","repo":"apache/iceberg","slug":"this-getclass-getname-does-not-implement-in","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/v3.5/spark/src/main/java/org/apache/iceberg/spark/source/SparkPositionDeltaWrite.java","lineNumber":615,"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":597,"sourceCodeEnd":633,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/source/SparkPositionDeltaWrite.java#L597-L633","documentation":"The position-delta writer's insert() entry point in this inner class is deliberately unsupported: inserts must go through the delegate with an explicit spec and partition projection, not this raw single-row API. Calling it fails fast naming the concrete class.","triggerScenarios":"Spark's writer framework invoking insert(InternalRow) directly on the position-delta writer class instead of the delegated insert(row, spec, partition) path.","commonSituations":"MERGE WHEN NOT MATCHED THEN INSERT routed to the wrong writer method, or custom write paths calling the generic insert API on a position-delta writer.","solutions":["Route inserts through the writer's spec-aware insert(row, spec, partitionProjection) path.","Verify the Spark action/delta plan is producing matching insert operations for the configured write mode.","If using MERGE, ensure write.merge/insert mode configuration matches the supported writer (e.g. copy-on-write for unsupported paths)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// call the spec-aware insert, not the raw insert(InternalRow)\nboolean safeToCall = writerSupportsInsertWithSpec(writer); // route inserts via delegate otherwise","typeGuard":null,"tryCatchPattern":"try { writer.insert(row); } catch (UnsupportedOperationException e) { delegateInsertWithSpec(writer, row); }","preventionTips":["Always use insert(row, spec, partitionProjection) for position-delta writers","Keep MERGE insert operations routed through the standard SparkWrite path","Avoid custom write code calling generic Writer APIs on delta writers"],"tags":["spark","delta-write","insert","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"}