{"record":{"id":"6d40137d9ca3a613","repo":"apache/iceberg","slug":"unknown-file-content-content","errorCode":null,"errorMessage":"Unknown file content: <content>","messagePattern":"Unknown file content: <content>","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"parquet/src/main/java/org/apache/iceberg/parquet/ParquetFormatModel.java","lineNumber":277,"sourceCode":"              schema == null,\n              \"Invalid schema: %s. Position deletes with schema are not supported by the API.\",\n              schema);\n          Preconditions.checkState(\n              engineSchema == null,\n              \"Invalid engineSchema: %s. Position deletes with schema are not supported by the API.\",\n              engineSchema);\n\n          internal.createContextFunc(Parquet.WriteBuilder.Context::deleteContext);\n          internal.createWriterFunc(\n              (icebergSchema, messageType) ->\n                  new ParquetValueWriters.PositionDeleteStructWriter<D>(\n                      (ParquetValueWriters.StructWriter<?>)\n                          GenericParquetWriter.create(icebergSchema, messageType),\n                      Function.identity()));\n          internal.schema(DeleteSchemaUtil.pathPosSchema());\n          break;\n        default:\n          throw new IllegalArgumentException(\"Unknown file content: \" + content);\n      }\n\n      if (shredVariants) {\n        return buildShreddedAppender();\n      }\n\n      return internal.build();\n    }\n\n    /**\n     * Creates a {@link BufferedFileAppender} that buffers the first N rows, runs variant shredding\n     * analysis on them, then creates the real Parquet appender with a shredded schema.\n     *\n     * <p>Only top-level variant columns are shredded. Nested variants (inside structs/lists/maps)\n     * fall through to unshredded 2-field layout because column index resolution only applies to\n     * top-level fields.\n     */\n    private FileAppender<D> buildShreddedAppender() {","sourceCodeStart":259,"sourceCodeEnd":295,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/parquet/src/main/java/org/apache/iceberg/parquet/ParquetFormatModel.java#L259-L295","documentation":"ParquetFormatModel.build() configures a Parquet write appender based on the file content type (DATA, POSITION_DELETES, EQUALITY_DELETES). If the supplied FileContent value is not one of the recognized kinds, the switch's default branch throws this IllegalArgumentException. It means the caller requested an unsupported/unrecognized file content type.","triggerScenarios":"Calling build() on a WriteBuilder whose file content was set to a value outside DATA/POSITION_DELETES/EQUALITY_DELETES — e.g. an unknown enum ordinal, a corrupted descriptor, or a content type added by a newer spec but not handled here.","commonSituations":"Custom or newer-spec file content constants used with an older Iceberg build; misconfigured delete-file writers passing the wrong FileContent.","solutions":["Set the write builder's content to a supported FileContent (DATA, POSITION_DELETES, EQUALITY_DELETES)","Verify the FileContent constant comes from the same Iceberg version as the writer code","Check how the content value is derived (e.g. from a manifest entry) for corruption or version skew"],"exampleFix":"// before\nWriteBuilder b = formatModel.write(input).content(FileContent.ENTRY_UNKNOWN);\n// after\nWriteBuilder b = formatModel.write(input).content(FileContent.DATA);","handlingStrategy":"validation","validationCode":"if (content != FileContent.DATA && content != FileContent.POSITION_DELETES\n    && content != FileContent.EQUALITY_DELETES) {\n  throw new IllegalArgumentException(\"Unsupported file content: \" + content);\n}","typeGuard":null,"tryCatchPattern":"try {\n  writer = formatModel.write(input).content(content).build();\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().startsWith(\"Unknown file content\")) { /* fix content constant */ }\n  throw e;\n}","preventionTips":["Only pass FileContent values defined by your Iceberg version","Derive content from manifest entries of the same spec version","Upgrade Iceberg when writing newer content types"],"tags":["parquet","writer","invalid-enum-value"],"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-23T08:17:48.524Z"}