apache/iceberg · error · UnsupportedOperationException

Unknown delete file content:

Error message

Unknown delete file content: 

What it means

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.

Source

Thrown at data/src/main/java/org/apache/iceberg/data/DeleteFilter.java:103

      boolean needRowPosCol) {
    this.filePath = filePath;
    this.counter = counter;
    this.expectedSchema = expectedSchema;

    ImmutableList.Builder<DeleteFile> posDeleteBuilder = ImmutableList.builder();
    ImmutableList.Builder<DeleteFile> eqDeleteBuilder = ImmutableList.builder();
    for (DeleteFile delete : deletes) {
      switch (delete.content()) {
        case POSITION_DELETES:
          LOG.debug("Adding position delete file {} to filter", delete.location());
          posDeleteBuilder.add(delete);
          break;
        case EQUALITY_DELETES:
          LOG.debug("Adding equality delete file {} to filter", delete.location());
          eqDeleteBuilder.add(delete);
          break;
        default:
          throw new UnsupportedOperationException(
              "Unknown delete file content: " + delete.content());
      }
    }

    this.posDeletes = posDeleteBuilder.build();
    this.eqDeletes = eqDeleteBuilder.build();
    this.requiredSchema =
        fileProjection(fieldLookup, expectedSchema, posDeletes, eqDeletes, needRowPosCol);
    this.posAccessor = requiredSchema.accessorForField(MetadataColumns.ROW_POSITION.fieldId());
    this.hasIsDeletedColumn =
        requiredSchema.findField(MetadataColumns.IS_DELETED.fieldId()) != null;
    this.isDeletedColumnPosition = requiredSchema.columns().indexOf(MetadataColumns.IS_DELETED);
  }

  protected DeleteFilter(
      String filePath,
      List<DeleteFile> deletes,
      Schema tableSchema,

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Upgrade the Iceberg library (all engines) to a version that supports the delete content type in the table metadata.
  2. Inspect the table's delete files (e.g. via AllDeleteFilesTable) to see which content type is present.
  3. Rewrite/compact the table with a compatible writer version to normalize delete files.
  4. Check for mixed Iceberg versions across jobs writing to the same table and align them.

Example fix

// before: old client fails on DV deletes written by newer writer
DeleteFilter filter = new GenericDeleteFilter(schema, spec, context, deletes);

// after: upgrade dependency so DV content is handled
// gradle: implementation 'org.apache.iceberg:iceberg-core:1.7.1'
DeleteFilter filter = new GenericDeleteFilter(schema, spec, context, deletes);
Defensive patterns

Strategy: validation

Validate before calling

deletes.forEach(d -> {
  if (d.content() != FileContent.POSITION_DELETES
      && d.content() != FileContent.EQUALITY_DELETES
      && d.content() != FileContent.POSITION_DELETES /* DV supported only in newer versions */) {
    throw new IllegalArgumentException("Unsupported delete content: " + d.content());
  }
});

Type guard

boolean isSupportedDelete(DeleteFile d) {
  return d.content() == FileContent.EQUALITY_DELETES || d.content() == FileContent.POSITION_DELETES;
}

Try / catch

try {
  DeleteFilter filter = new GenericDeleteFilter(schema, spec, context, deletes);
} catch (UnsupportedOperationException e) {
  if (e.getMessage().startsWith("Unknown delete file content")) { upgradeLibraryOrRewriteDeletes(); }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/23b8bed632260d93. Report an issue: GitHub.