{"record":{"id":"182da593eaa6b4b9","repo":"apache/iceberg","slug":"unsupported-file-content-type-182da5","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/PartitionsTable.java","lineNumber":357,"sourceCode":"        }\n      }\n\n      switch (file.content()) {\n        case DATA:\n          this.dataRecordCount += file.recordCount();\n          this.dataFileCount += 1;\n          this.dataFileSizeInBytes += file.fileSizeInBytes();\n          break;\n        case POSITION_DELETES:\n          this.posDeleteRecordCount += file.recordCount();\n          this.posDeleteFileCount += 1;\n          break;\n        case EQUALITY_DELETES:\n          this.eqDeleteRecordCount += file.recordCount();\n          this.eqDeleteFileCount += 1;\n          break;\n        default:\n          throw new UnsupportedOperationException(\n              \"Unsupported file content type: \" + file.content());\n      }\n    }\n\n    /** Needed because StructProjection is not serializable */\n    private static PartitionData toPartitionData(\n        StructLike key, PartitionData partitionDataTemplate) {\n      return partitionDataTemplate.copyFor(key);\n    }\n  }\n}\n","sourceCodeStart":339,"sourceCodeEnd":369,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/PartitionsTable.java#L339-L369","documentation":"PartitionsTable's internal task accumulates counts per file content type when building the partitions metadata table rows; unknown FileContent values throw UnsupportedOperationException. Like errors 586/587, this rejects file content kinds the current version does not know how to categorize.","triggerScenarios":"Querying the table's 'partitions' metadata table (SELECT * FROM table.partitions) when a data file/manifest entry has a FileContent outside DATA/POSITION_DELETES/EQUALITY_DELETES.","commonSituations":"Reading partitions metadata of a table written by a newer Iceberg or experimental format version that introduces new file content types.","solutions":["Upgrade the Iceberg runtime (Spark/Flink plugin and core) to match the writer version that introduced the new content type.","Identify the offending file via the table's manifests and compact/rewrite it with a supported version.","Avoid querying the partitions metadata table on tables containing unsupported content types until upgraded."],"exampleFix":"// before (old runtime)\nspark.sql(\"SELECT * FROM tbl.partitions\"); // throws on unknown content\n// after\n// upgrade iceberg-spark runtime so the switch covers the new FileContent","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  spark.sql(\"SELECT * FROM tbl.partitions\").collect();\n} catch (UnsupportedOperationException e) {\n  if (!e.getMessage().contains(\"Unsupported file content type\")) throw e;\n  // surface a clear error advising a runtime upgrade\n}","preventionTips":["Match the Spark/Flink Iceberg plugin version to the version that wrote the table.","Verify all file contents in table manifests before querying metadata tables after a writer upgrade.","Plan runtime upgrades before adopting tables written by newer Iceberg builds."],"tags":["unsupported-enum-value","file-content","metadata-table","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"}