{"record":{"id":"56ee5e977ac49b1b","repo":"apache/iceberg","slug":"unexpected-delete-file-content-56ee5e","errorCode":null,"errorMessage":"Unexpected delete file content: ","messagePattern":"Unexpected delete file content: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/maintenance/operator/TableChange.java","lineNumber":85,"sourceCode":"    dataFiles.forEach(\n        dataFile -> {\n          this.dataFileCount++;\n          this.dataFileSizeInBytes += dataFile.fileSizeInBytes();\n        });\n\n    deleteFiles.forEach(\n        deleteFile -> {\n          switch (deleteFile.content()) {\n            case POSITION_DELETES:\n              this.posDeleteFileCount++;\n              this.posDeleteRecordCount += deleteFile.recordCount();\n              break;\n            case EQUALITY_DELETES:\n              this.eqDeleteFileCount++;\n              this.eqDeleteRecordCount += deleteFile.recordCount();\n              break;\n            default:\n              throw new IllegalArgumentException(\"Unexpected delete file content: \" + deleteFile);\n          }\n        });\n\n    this.commitCount = 1;\n  }\n\n  static TableChange empty() {\n    return new TableChange(0, 0L, 0, 0L, 0, 0L, 0);\n  }\n\n  public static Builder builder() {\n    return new Builder();\n  }\n\n  int dataFileCount() {\n    return dataFileCount;\n  }\n","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/maintenance/operator/TableChange.java#L67-L103","documentation":"When aggregating TableChanges, each delete file's content() must be one of the known delete content kinds (position deletes or equality deletes). If a ContentFile reports some other delete content type, the constructor throws IllegalArgumentException, because the maintenance metrics cannot be classified.","triggerScenarios":"Encountering a delete file whose content() is a new/unknown Iceberg content type (e.g. written by a newer Iceberg writer using content kinds unknown to this version) while building a TableChange from a table's new files.","commonSituations":"Tables written by a newer Iceberg engine version with delete kinds this Flink runtime doesn't know; custom file implementations returning unexpected content(); reading a table written with DVs/other content by a mismatched runtime.","solutions":["Upgrade the iceberg-flink-runtime dependency to a version that recognizes the delete content type used by the writers","Check which jobs/writers produce the delete files and align Iceberg versions across the pipeline","Inspect the offending ContentFile.content() value and confirm the table was not written by an experimental/newer format","If a custom ContentFile is in play, fix it to return only the supported delete content types"],"exampleFix":"// before: older runtime reading DV-based delete files\nTableChange change = new TableChange(tableLoader, ...); // IllegalArgumentException: Unexpected delete file content: ...\n// after: upgrade runtime\nimplementation('org.apache.iceberg:iceberg-flink-runtime-1.20:<newer-version>');","handlingStrategy":"type-guard","validationCode":"// before building TableChange from delete files\nSet<ContentFile.Content> supported = EnumSet.of(ContentFile.Content.POSITION_DELETES, ContentFile.Content.EQUALITY_DELETES);\nfor (ContentFile<?> f : deleteFiles) {\n  Preconditions.checkState(f.content() != ContentFile.Content.DATA && supported.contains(f.content()),\n      \"Unsupported delete content %s\", f.content());\n}","typeGuard":"static boolean isSupportedDeleteContent(ContentFile<?> f) {\n  return f.content() == ContentFile.Content.POSITION_DELETES || f.content() == ContentFile.Content.EQUALITY_DELETES;\n}","tryCatchPattern":"try {\n  new TableChange(...);\n} catch (IllegalArgumentException e) {\n  LOG.error(\"Unknown delete content; runtime too old for this table's writers\", e);\n  throw e;\n}","preventionTips":["Keep writer and maintenance runtime Iceberg versions aligned","Upgrade iceberg-flink-runtime when the writers start using new delete content kinds","Validate tables' delete files in CI after engine upgrades"],"tags":["flink","delete-files","content-type","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"}