{"record":{"id":"23b8bed632260d93","repo":"apache/iceberg","slug":"unknown-delete-file-content","errorCode":null,"errorMessage":"Unknown delete file content: ","messagePattern":"Unknown delete file content: ","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"data/src/main/java/org/apache/iceberg/data/DeleteFilter.java","lineNumber":103,"sourceCode":"      boolean needRowPosCol) {\n    this.filePath = filePath;\n    this.counter = counter;\n    this.expectedSchema = expectedSchema;\n\n    ImmutableList.Builder<DeleteFile> posDeleteBuilder = ImmutableList.builder();\n    ImmutableList.Builder<DeleteFile> eqDeleteBuilder = ImmutableList.builder();\n    for (DeleteFile delete : deletes) {\n      switch (delete.content()) {\n        case POSITION_DELETES:\n          LOG.debug(\"Adding position delete file {} to filter\", delete.location());\n          posDeleteBuilder.add(delete);\n          break;\n        case EQUALITY_DELETES:\n          LOG.debug(\"Adding equality delete file {} to filter\", delete.location());\n          eqDeleteBuilder.add(delete);\n          break;\n        default:\n          throw new UnsupportedOperationException(\n              \"Unknown delete file content: \" + delete.content());\n      }\n    }\n\n    this.posDeletes = posDeleteBuilder.build();\n    this.eqDeletes = eqDeleteBuilder.build();\n    this.requiredSchema =\n        fileProjection(fieldLookup, expectedSchema, posDeletes, eqDeletes, needRowPosCol);\n    this.posAccessor = requiredSchema.accessorForField(MetadataColumns.ROW_POSITION.fieldId());\n    this.hasIsDeletedColumn =\n        requiredSchema.findField(MetadataColumns.IS_DELETED.fieldId()) != null;\n    this.isDeletedColumnPosition = requiredSchema.columns().indexOf(MetadataColumns.IS_DELETED);\n  }\n\n  protected DeleteFilter(\n      String filePath,\n      List<DeleteFile> deletes,\n      Schema tableSchema,","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/data/src/main/java/org/apache/iceberg/data/DeleteFilter.java#L85-L121","documentation":"DeleteFilter's constructor partitions delete files by content type (position deletes, equality deletes). If a delete file's content() is neither EQUALITY_DELETES, POSITION_DELETES, nor DV (any future/unknown enum value), an UnsupportedOperationException is thrown. This guards against delete-file types this filter cannot apply.","triggerScenarios":"Constructing a DeleteFilter (or subclass such as GenericDeleteFilter/SparkDeleteFilter) with a list of DeleteFile whose content() is an unrecognized enum value — e.g. reading tables written by a newer Iceberg spec version that introduces a new delete content type.","commonSituations":"Running an older Iceberg client against metadata produced by a newer engine/writer that emits unsupported delete content; corrupted metadata returning unexpected content values; custom catalogs injecting malformed DeleteFile objects.","solutions":["Upgrade the Iceberg library (all engines) to a version that supports the delete content type in the table metadata.","Inspect the table's delete files (e.g. via AllDeleteFilesTable) to see which content type is present.","Rewrite/compact the table with a compatible writer version to normalize delete files.","Check for mixed Iceberg versions across jobs writing to the same table and align them."],"exampleFix":"// before: old client fails on DV deletes written by newer writer\nDeleteFilter filter = new GenericDeleteFilter(schema, spec, context, deletes);\n\n// after: upgrade dependency so DV content is handled\n// gradle: implementation 'org.apache.iceberg:iceberg-core:1.7.1'\nDeleteFilter filter = new GenericDeleteFilter(schema, spec, context, deletes);","handlingStrategy":"validation","validationCode":"deletes.forEach(d -> {\n  if (d.content() != FileContent.POSITION_DELETES\n      && d.content() != FileContent.EQUALITY_DELETES\n      && d.content() != FileContent.POSITION_DELETES /* DV supported only in newer versions */) {\n    throw new IllegalArgumentException(\"Unsupported delete content: \" + d.content());\n  }\n});","typeGuard":"boolean isSupportedDelete(DeleteFile d) {\n  return d.content() == FileContent.EQUALITY_DELETES || d.content() == FileContent.POSITION_DELETES;\n}","tryCatchPattern":"try {\n  DeleteFilter filter = new GenericDeleteFilter(schema, spec, context, deletes);\n} catch (UnsupportedOperationException e) {\n  if (e.getMessage().startsWith(\"Unknown delete file content\")) { upgradeLibraryOrRewriteDeletes(); }\n}","preventionTips":["Keep all engines' Iceberg versions aligned with the writer version that produced the table.","Audit delete files via metadata tables before upgrading/reading across versions.","Pin writer format versions the readers can handle."],"tags":["delete-files","unsupported-operation","format-version","enum"],"backgroundTag":"unsupported-enum-value","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"}