apache/iceberg · error · UnsupportedOperationException

Unsupported delete file type:

Error message

Unsupported delete file type: 

What it means

RewriteTablePathUtil.writeDeleteFileEntry handles only POSITION_DELETES and EQUALITY_DELETES content types when rewriting delete manifests. Any other FileContent value (e.g. an unknown future content type from a newer spec) falls into the default branch and throws UnsupportedOperationException. It signals the reader encountered an unrecognized delete file type.

Source

Thrown at core/src/main/java/org/apache/iceberg/RewriteTablePathUtil.java:585

                      stagingPath(file.location(), sourcePrefix, stagingLocation),
                      posDeleteFile.location()));
        }
        result.toRewrite().add(file.copy());
        return result;
      case EQUALITY_DELETES:
        DeleteFile eqDeleteFile = newEqualityDeleteEntry(file, spec, sourcePrefix, targetPrefix);
        appendEntryWithFile(entry, writer, eqDeleteFile);
        // keep the following entries in metadata but exclude them from copyPlan
        // 1) deleted equality delete files
        // 2) entries not changed by snapshotIds
        if (entry.isLive() && snapshotIds.contains(entry.snapshotId())) {
          // No need to rewrite equality delete files as they do not contain absolute file paths.
          result.copyPlan().add(Pair.of(file.location(), eqDeleteFile.location()));
        }
        return result;

      default:
        throw new UnsupportedOperationException("Unsupported delete file type: " + file.content());
    }
  }

  private static <F extends ContentFile<F>> void appendEntryWithFile(
      ManifestEntry<F> entry, ManifestWriter<F> writer, F file) {

    switch (entry.status()) {
      case ADDED:
        writer.add(file);
        break;
      case EXISTING:
        writer.existing(
            file, entry.snapshotId(), entry.dataSequenceNumber(), entry.fileSequenceNumber());
        break;
      case DELETED:
        writer.delete(file, entry.dataSequenceNumber(), entry.fileSequenceNumber());
        break;
    }

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Upgrade to an Iceberg version whose RewriteTablePathUtil recognizes the file content type present in the table
  2. Verify the table's manifests are well-formed (delete manifests should contain only position/equality delete files); repair metadata if a DATA file appears in a delete manifest
  3. Rewrite the table with a matching-version writer so no unknown content types are produced before relocation

Example fix

// before
// old version: default -> throw new UnsupportedOperationException("Unsupported delete file type: " + file.content());
// after
// upgrade iceberg to a version handling the new FileContent, or guard:
if (file.content() != FileContent.POSITION_DELETES && file.content() != FileContent.EQUALITY_DELETES) {
  throw new UnsupportedOperationException("Unsupported delete file type: " + file.content());
}
Defensive patterns

Strategy: type-guard

Validate before calling

if (file.content() != FileContent.POSITION_DELETES && file.content() != FileContent.EQUALITY_DELETES) {
  throw new IllegalStateException("Rewrite does not support delete content type: " + file.content());
}

Type guard

boolean isKnownDeleteContent(DeleteFile f) {
  return f.content() == FileContent.POSITION_DELETES || f.content() == FileContent.EQUALITY_DELETES;
}

Try / catch

try {
  RewriteTablePathUtil.rewriteDeleteManifest(/* ... */);
} catch (UnsupportedOperationException e) {
  // unknown delete file content type; check Iceberg version compatibility
}

Prevention

When it happens

Trigger: Rewriting a delete manifest (rewriteDeleteManifest path of RewriteTablePathUtil, i.e. table relocation/staging copy) where a delete file entry has a FileContent not covered by the switch — typically DATA misrouted into a delete manifest or a content type introduced by a newer format version.

Common situations: Tables written by newer Iceberg versions then processed by an older version lacking the new content type; corrupted/foreign manifest files passed to the rewrite utility.

Related errors


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