{"record":{"id":"ee2663ac95868f85","repo":"apache/iceberg","slug":"unknown-file-content-ee2663","errorCode":null,"errorMessage":"Unknown file content: ","messagePattern":"Unknown file content: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"orc/src/main/java/org/apache/iceberg/orc/ORCFormatModel.java","lineNumber":202,"sourceCode":"          Preconditions.checkState(\n              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(ORC.WriteBuilder.Context::deleteContext);\n          internal.createWriterFunc(\n              (icebergSchema, typeDescription) ->\n                  GenericOrcWriters.positionDelete(\n                      GenericOrcWriter.buildWriter(icebergSchema, typeDescription),\n                      Function.identity()));\n          internal.schema(DeleteSchemaUtil.pathPosSchema());\n          break;\n        default:\n          throw new IllegalArgumentException(\"Unknown file content: \" + content);\n      }\n\n      return internal.build();\n    }\n  }\n\n  private static class ReadBuilderWrapper<D, S, R> implements ReadBuilder<D, S> {\n    private final ORC.ReadBuilder internal;\n    private final ReaderFunction<R, S, TypeDescription> readerFunction;\n    private final boolean isBatchReader;\n    private S engineSchema;\n    private boolean reuseContainers = false;\n    private Schema icebergSchema;\n    private Map<Integer, ?> idToConstant = ImmutableMap.of();\n\n    private ReadBuilderWrapper(\n        InputFile inputFile,\n        ReaderFunction<R, S, TypeDescription> readerFunction,","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/orc/src/main/java/org/apache/iceberg/orc/ORCFormatModel.java#L184-L220","documentation":"ORCFormatModel.build() dispatches on the configured FileContent (DATA, POSITION_DELETES, EQUALITY_DELETES, etc.). If the content field holds an unrecognized value (e.g. a newer FileContent enum constant or a null/uninitialized content), the default branch throws IllegalArgumentException with this message.","triggerScenarios":"Building an ORC appender whose FileContent is not one of the handled cases — typically an uninitialized/incorrectly set builder or a new content type added to Iceberg but not yet supported by the ORC writer.","commonSituations":"Custom writer tooling that sets FileContent incorrectly; forward-compatibility gap where a table uses a newer spec feature (e.g. new delete type) with an older Iceberg ORC writer.","solutions":["Ensure the write builder sets FileContent correctly (DATA for data files, POSITION_DELETES for position deletes)","Upgrade Iceberg if writing a newer file content type not supported by the installed ORC writer","Check that custom builder code doesn't pass null or an out-of-range content value"],"exampleFix":"// before\nbuilder.content(null).build(); // IllegalArgumentException\n// after\nbuilder.content(FileContent.DATA).build();","handlingStrategy":"validation","validationCode":"FileContent content = builderContent();\nif (content != FileContent.DATA && content != FileContent.POSITION_DELETES && content != FileContent.EQUALITY_DELETES) {\n  throw new IllegalArgumentException(\"Unsupported file content for ORC: \" + content);\n}","typeGuard":"boolean orcContentSupported(FileContent c) {\n  return c == FileContent.DATA || c == FileContent.POSITION_DELETES || c == FileContent.EQUALITY_DELETES;\n}","tryCatchPattern":"try {\n  appender = formatModel.build();\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().startsWith(\"Unknown file content\")) {\n    throw new IllegalStateException(\"Set FileContent explicitly before building ORC appender\", e);\n  } throw e;\n}","preventionTips":["Always set FileContent explicitly on write builders","Upgrade Iceberg when using newer file content types","Never pass null FileContent into an ORC appender build"],"tags":["orc","write","invalid-enum","file-content"],"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"}