{"record":{"id":"07a32378015c0c52","repo":"apache/iceberg","slug":"illegal-file-type-s","errorCode":null,"errorMessage":"Illegal file type: %s","messagePattern":"Illegal file type: (.+?)","errorType":"validation","errorClass":"ValidationException","httpStatus":null,"severity":"error","filePath":"spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/actions/BaseSparkAction.java","lineNumber":331,"sourceCode":"        positionDeleteFilesCount.addAndGet(numFiles);\n\n      } else if (FileContent.EQUALITY_DELETES.name().equalsIgnoreCase(type)) {\n        equalityDeleteFilesCount.addAndGet(numFiles);\n\n      } else if (MANIFEST.equalsIgnoreCase(type)) {\n        manifestsCount.addAndGet(numFiles);\n\n      } else if (MANIFEST_LIST.equalsIgnoreCase(type)) {\n        manifestListsCount.addAndGet(numFiles);\n\n      } else if (STATISTICS_FILES.equalsIgnoreCase(type)) {\n        statisticsFilesCount.addAndGet(numFiles);\n\n      } else if (OTHERS.equalsIgnoreCase(type)) {\n        otherFilesCount.addAndGet(numFiles);\n\n      } else {\n        throw new ValidationException(\"Illegal file type: %s\", type);\n      }\n    }\n\n    public void deletedFile(String path, String type) {\n      if (FileContent.DATA.name().equalsIgnoreCase(type)) {\n        dataFilesCount.incrementAndGet();\n        LOG.trace(\"Deleted data file: {}\", path);\n\n      } else if (FileContent.POSITION_DELETES.name().equalsIgnoreCase(type)) {\n        positionDeleteFilesCount.incrementAndGet();\n        LOG.trace(\"Deleted positional delete file: {}\", path);\n\n      } else if (FileContent.EQUALITY_DELETES.name().equalsIgnoreCase(type)) {\n        equalityDeleteFilesCount.incrementAndGet();\n        LOG.trace(\"Deleted equality delete file: {}\", path);\n\n      } else if (MANIFEST.equalsIgnoreCase(type)) {\n        manifestsCount.incrementAndGet();","sourceCodeStart":313,"sourceCodeEnd":349,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/actions/BaseSparkAction.java#L313-L349","documentation":"ValidationException raised by the file-counting listener in BaseSparkAction when deleteOperation/deletedFiles receives a file type string that is not DATA, DATA_FILE, POSITION_DELETES, EQUALITY_DELETES, or OTHERS. It guards the counting logic that classifies manifest-deleted files during rewrite/cleanup actions.","triggerScenarios":"Executing SparkActions like removeOrphanFiles/rewriteDataFiles/deleteReachableFiles against a table whose metadata contains content types this connector version does not recognize (e.g. newer file content kinds).","commonSituations":"Older Spark connector processing metadata produced by a newer Iceberg writer that introduced a new content type; corrupted or hand-edited table metadata.","solutions":["Upgrade the Iceberg Spark runtime so the new file content type is recognized","Ensure writer and reader Iceberg versions are compatible","If reproducible with valid metadata, file an issue — a new Iceberg content type must be added to the classifier"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"Set<String> known = Set.of(\"DATA\", \"POSITION_DELETES\", \"EQUALITY_DELETES\", \"OTHERS\");\n// verify all file contents in table metadata are known before running actions","typeGuard":null,"tryCatchPattern":"try { SparkActions.get(spark).removeOrphanFiles(table).execute(); } catch (ValidationException e) { /* unknown file content type; upgrade connector */ }","preventionTips":["Keep the Spark connector at or above the writer's Iceberg version","Check table metadata file content kinds before running cleanup actions","Monitor Iceberg release notes for new file content types"],"tags":["spark","actions","validation"],"backgroundTag":"invalid-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"}