{"record":{"id":"0a5dbc87bbef2011","repo":"apache/iceberg","slug":"unexpected-delete-file-content","errorCode":null,"errorMessage":"Unexpected delete file content: ","messagePattern":"Unexpected delete file content: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"flink/v2.1/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.1/flink/src/main/java/org/apache/iceberg/flink/maintenance/operator/TableChange.java#L67-L103","documentation":"TableChange aggregates per-checkpoint changes to an Iceberg table for the Flink maintenance (compaction) pipeline. When summarizing DataFile/DeleteFile changes, it switches on the file content type; a DeleteFile whose content is neither EQUALITY_DELETES nor POSITION_DELETES (nor a data case) has no handling branch, so the switch's default throws this IllegalArgumentException to fail fast rather than silently miscounting deletes.","triggerScenarios":"Constructing a TableChange from DeleteFile entries where a file's content() returns a value outside the handled cases — e.g. a new/unknown DeleteFileContent enum value from a newer Iceberg format version, or a corrupt/incorrectly-typed DeleteFile passed into the TableChange constructor.","commonSituations":"Running the Flink maintenance topology against a table written by a newer Iceberg version introducing new delete content types; corrupted metadata listing malformed delete files; classpath mixing Iceberg versions so enum constants mismatch.","solutions":["Align the Iceberg runtime version used by Flink with the version that wrote the table's delete files (avoid mixed Iceberg jars on the classpath).","Inspect the delete file's content() value and confirm the table spec/format version is one the maintenance operator supports.","Upgrade the Iceberg Flink runtime to a release that handles the new delete content type.","If the file is genuinely corrupt, remove/rewrite the offending delete file via a rewrite or repair procedure."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (deleteFile.content() != FileContent.EQUALITY_DELETES && deleteFile.content() != FileContent.POSITION_DELETES) {\n  throw new IllegalStateException(\"Unsupported delete content on table: \" + deleteFile.content());\n}","typeGuard":"boolean isSupportedDelete(DeleteFile f) {\n  return f.content() == FileContent.EQUALITY_DELETES || f.content() == FileContent.POSITION_DELETES;\n}","tryCatchPattern":"try { tableChange = new TableChange(...); } catch (IllegalArgumentException e) { LOG.error(\"Unsupported delete file content; check Iceberg version alignment\", e); }","preventionTips":["Keep Iceberg runtime versions identical across writers, Flink jobs, and maintenance topologies.","Pin the Iceberg version in your build and avoid shaded/mixed jars on the cluster classpath.","Before enabling maintenance on a table written by other tools, scan its delete file content types."],"tags":["flink","iceberg","delete-files","unknown-enum-value","maintenance"],"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-14T11:17:12.474Z"}