{"record":{"id":"6d078ae778508701","repo":"apache/iceberg","slug":"unsupported-file-content-type","errorCode":null,"errorMessage":"Unsupported file content type: ","messagePattern":"Unsupported file content type: ","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/PartitionStatsHandler.java","lineNumber":389,"sourceCode":"        if (file.format() == FileFormat.PUFFIN) {\n          stats.set(PartitionStatistics.DV_COUNT_POSITION, stats.dvCount() + 1);\n        } else {\n          stats.set(\n              PartitionStatistics.POSITION_DELETE_FILE_COUNT_POSITION,\n              stats.positionDeleteFileCount() + 1);\n        }\n\n        break;\n      case EQUALITY_DELETES:\n        stats.set(\n            PartitionStatistics.EQUALITY_DELETE_RECORD_COUNT_POSITION,\n            stats.equalityDeleteRecordCount() + file.recordCount());\n        stats.set(\n            PartitionStatistics.EQUALITY_DELETE_FILE_COUNT_POSITION,\n            stats.equalityDeleteFileCount() + 1);\n        break;\n      default:\n        throw new UnsupportedOperationException(\"Unsupported file content type: \" + file.content());\n    }\n\n    if (snapshot != null) {\n      updateSnapshotInfo(stats, snapshot.snapshotId(), snapshot.timestampMillis());\n    }\n\n    // Note: Not computing the `TOTAL_RECORD_COUNT` for now as it needs scanning the data.\n  }\n\n  /**\n   * Updates the modified time and snapshot ID in stats for the deleted manifest entry.\n   *\n   * @param stats partition statistics to be updated.\n   * @param snapshot the snapshot corresponding to the deleted manifest entry.\n   */\n  private static void deletedEntry(PartitionStatistics stats, Snapshot snapshot) {\n    if (snapshot != null) {\n      updateSnapshotInfo(stats, snapshot.snapshotId(), snapshot.timestampMillis());","sourceCodeStart":371,"sourceCodeEnd":407,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/PartitionStatsHandler.java#L371-L407","documentation":"PartitionStatsHandler.collectStatsForManifest accumulates per-file statistics by switching on FileContent (DATA, POSITION_DELETES, EQUALITY_DELETES); an unknown content enum value hits the default branch and throws UnsupportedOperationException. This guards against new FileContent kinds (or corrupted/forward-compat manifests) reaching stats computation unhandled.","triggerScenarios":"Computing partition statistics (PartitionStatsHandler.computeAndWrite/collectStats) over a manifest whose FileContent enum value is not one of the three known kinds — e.g. a future format version introducing new content types or a corrupt manifest entry.","commonSituations":"Using a current Iceberg version against metadata files written by a newer experimental version that defines additional file content types.","solutions":["Upgrade Iceberg to a version that handles the new file content type present in the manifests.","Inspect the offending manifest entry's content field to identify the unexpected value.","Exclude tables/manifests with unknown content types from partition-stats computation until the writer version is supported."],"exampleFix":"// before (older Iceberg lacking the case)\nPartitionStatsHandler.computeAndWrite(...); // throws on unknown content\n// after (upgrade so the switch handles the new content)\ncase UNKNOWN_NEW_CONTENT:\n  // handle or skip the entry\n  break;","handlingStrategy":"try-catch","validationCode":"boolean allKnown = manifest.entries().stream().allMatch(e ->\n    e.file().content() == FileContent.DATA\n    || e.file().content() == FileContent.POSITION_DELETES\n    || e.file().content() == FileContent.EQUALITY_DELETES);","typeGuard":null,"tryCatchPattern":"try {\n  PartitionStatsHandler.computeAndWrite(...);\n} catch (UnsupportedOperationException e) {\n  if (!e.getMessage().contains(\"Unsupported file content type\")) throw e;\n  LOG.warn(\"Manifest contains unsupported file content; upgrade Iceberg\", e);\n}","preventionTips":["Keep reader and writer Iceberg versions aligned.","Detect forward-compat manifests early by checking format/content versions at table open.","Test stats procedures in staging before rolling out new writer versions."],"tags":["unsupported-enum-value","file-content","partition-stats","java"],"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"}