{"record":{"id":"3ebeafd7356eb347","repo":"apache/iceberg","slug":"unsupported-delete-file-type","errorCode":null,"errorMessage":"Unsupported delete file type: ","messagePattern":"Unsupported delete file type: ","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/RewriteTablePathUtil.java","lineNumber":585,"sourceCode":"                      stagingPath(file.location(), sourcePrefix, stagingLocation),\n                      posDeleteFile.location()));\n        }\n        result.toRewrite().add(file.copy());\n        return result;\n      case EQUALITY_DELETES:\n        DeleteFile eqDeleteFile = newEqualityDeleteEntry(file, spec, sourcePrefix, targetPrefix);\n        appendEntryWithFile(entry, writer, eqDeleteFile);\n        // keep the following entries in metadata but exclude them from copyPlan\n        // 1) deleted equality delete files\n        // 2) entries not changed by snapshotIds\n        if (entry.isLive() && snapshotIds.contains(entry.snapshotId())) {\n          // No need to rewrite equality delete files as they do not contain absolute file paths.\n          result.copyPlan().add(Pair.of(file.location(), eqDeleteFile.location()));\n        }\n        return result;\n\n      default:\n        throw new UnsupportedOperationException(\"Unsupported delete file type: \" + file.content());\n    }\n  }\n\n  private static <F extends ContentFile<F>> void appendEntryWithFile(\n      ManifestEntry<F> entry, ManifestWriter<F> writer, F file) {\n\n    switch (entry.status()) {\n      case ADDED:\n        writer.add(file);\n        break;\n      case EXISTING:\n        writer.existing(\n            file, entry.snapshotId(), entry.dataSequenceNumber(), entry.fileSequenceNumber());\n        break;\n      case DELETED:\n        writer.delete(file, entry.dataSequenceNumber(), entry.fileSequenceNumber());\n        break;\n    }","sourceCodeStart":567,"sourceCodeEnd":603,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/RewriteTablePathUtil.java#L567-L603","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Upgrade to an Iceberg version whose RewriteTablePathUtil recognizes the file content type present in the table","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","Rewrite the table with a matching-version writer so no unknown content types are produced before relocation"],"exampleFix":"// before\n// old version: default -> throw new UnsupportedOperationException(\"Unsupported delete file type: \" + file.content());\n// after\n// upgrade iceberg to a version handling the new FileContent, or guard:\nif (file.content() != FileContent.POSITION_DELETES && file.content() != FileContent.EQUALITY_DELETES) {\n  throw new UnsupportedOperationException(\"Unsupported delete file type: \" + file.content());\n}","handlingStrategy":"type-guard","validationCode":"if (file.content() != FileContent.POSITION_DELETES && file.content() != FileContent.EQUALITY_DELETES) {\n  throw new IllegalStateException(\"Rewrite does not support delete content type: \" + file.content());\n}","typeGuard":"boolean isKnownDeleteContent(DeleteFile f) {\n  return f.content() == FileContent.POSITION_DELETES || f.content() == FileContent.EQUALITY_DELETES;\n}","tryCatchPattern":"try {\n  RewriteTablePathUtil.rewriteDeleteManifest(/* ... */);\n} catch (UnsupportedOperationException e) {\n  // unknown delete file content type; check Iceberg version compatibility\n}","preventionTips":["Keep reader and writer Iceberg versions aligned during relocation","Inspect manifest content types before running rewrite utilities","Validate manifest integrity before table migration"],"tags":["iceberg","delete-files","version-compatibility"],"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"}