{"record":{"id":"1089ce96ffce0e2e","repo":"apache/iceberg","slug":"position-delete-writer-does-not-support-row-data","errorCode":null,"errorMessage":"Position delete writer does not support row data","messagePattern":"Position delete writer does not support row data","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/avro/Avro.java","lineNumber":542,"sourceCode":"          FileFormat.AVRO,\n          location,\n          spec,\n          partition,\n          keyMetadata,\n          sortOrder,\n          equalityFieldIds);\n    }\n\n    public <T> PositionDeleteWriter<T> buildPositionWriter() throws IOException {\n      Preconditions.checkState(\n          equalityFieldIds == null, \"Cannot create position delete file using delete field ids\");\n      Preconditions.checkArgument(\n          spec != null, \"Spec must not be null when creating position delete writer\");\n      Preconditions.checkArgument(\n          spec.isUnpartitioned() || partition != null,\n          \"Partition must not be null for partitioned writes\");\n      if (rowSchema != null) {\n        throw new UnsupportedOperationException(\"Position delete writer does not support row data\");\n      }\n\n      meta(\"delete-type\", \"position\");\n\n      appenderBuilder.schema(DeleteSchemaUtil.pathPosSchema());\n\n      // the createWriterFunc is ignored, since only the path and position are written\n      appenderBuilder.createWriterFunc(ignored -> new PositionDatumWriter());\n\n      appenderBuilder.createContextFunc(WriteBuilder.Context::deleteContext);\n\n      return new PositionDeleteWriter<>(\n          appenderBuilder.build(), FileFormat.AVRO, location, spec, partition, keyMetadata);\n    }\n  }\n\n  /** A {@link DatumWriter} implementation that wraps another to produce position deletes. */\n  static class PositionDatumWriter implements MetricsAwareDatumWriter<PositionDelete<?>> {","sourceCodeStart":524,"sourceCodeEnd":560,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/avro/Avro.java#L524-L560","documentation":"Guard inside Avro's PositionDeleteWriter builder path: position-delete files index deletions by (file, position) and cannot carry row data, so building/configuring a position writer with row-oriented settings is rejected. Related preconditions in the same builder reject equality-field IDs and missing partition specs; this message specifically flags row data on a position delete writer.","triggerScenarios":"Thrown at core/src/main/java/org/apache/iceberg/avro/Avro.java:542 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use an equality-delete writer when row data/fields are required","Configure the delete writer without row-data settings for position deletes","Do not set equality field IDs when building a position delete writer"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}