{"record":{"id":"18c389f2b4c2efbc","repo":"apache/iceberg","slug":"cannot-read-using-unregistered-internal-data-forma","errorCode":null,"errorMessage":"Cannot read using unregistered internal data format: %s","messagePattern":"Cannot read using unregistered internal data format: (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/InternalData.java","lineNumber":101,"sourceCode":"  }\n\n  public static WriteBuilder write(FileFormat format, OutputFile file) {\n    Function<OutputFile, WriteBuilder> writeBuilder = WRITE_BUILDERS.get(format);\n    if (writeBuilder != null) {\n      return writeBuilder.apply(file);\n    }\n\n    throw new UnsupportedOperationException(\n        \"Cannot write using unregistered internal data format: \" + format);\n  }\n\n  public static ReadBuilder read(FileFormat format, InputFile file) {\n    Function<InputFile, ReadBuilder> readBuilder = READ_BUILDERS.get(format);\n    if (readBuilder != null) {\n      return readBuilder.apply(file);\n    }\n\n    throw new UnsupportedOperationException(\n        \"Cannot read using unregistered internal data format: \" + format);\n  }\n\n  public interface WriteBuilder {\n    /** Set the file schema. */\n    WriteBuilder schema(Schema schema);\n\n    /** Set the file schema's root name. */\n    WriteBuilder named(String name);\n\n    /**\n     * Set a writer configuration property.\n     *\n     * <p>Write configuration affects writer behavior. To add file metadata properties, use {@link\n     * #meta(String, String)}.\n     *\n     * @param property a writer config property name\n     * @param value config value","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/InternalData.java#L83-L119","documentation":"InternalData.read() only supports file formats with a registered ReadBuilder. Requesting a read with an unregistered FileFormat throws UnsupportedOperationException since no internal reader exists for that format.","triggerScenarios":"Calling InternalData.read(FileFormat.X, inputFile) where X is not in READ_BUILDERS — e.g., an unknown format, or a format with no read support registered.","commonSituations":"Reading internal metadata files (manifests, statistics, position deletes) whose format was misconfigured or produced by a non-standard writer; new FileFormat enum value without a registered reader.","solutions":["Read with a registered format (AVRO, PARQUET, ORC) matching how the file was written","Register a custom ReadBuilder if supporting a new format","Verify the file's actual format — it may have been written by a non-Iceberg tool"],"exampleFix":"// before\nInternalData.read(FileFormat.fromString(\"json\"), in)...\n// after\nInternalData.read(FileFormat.PARQUET, in)...","handlingStrategy":"validation","validationCode":"if (format != FileFormat.AVRO && format != FileFormat.PARQUET && format != FileFormat.ORC) {\n  throw new IllegalArgumentException(\"Unsupported internal format: \" + format);\n}","typeGuard":null,"tryCatchPattern":"try {\n  InternalData.read(format, file)...;\n} catch (UnsupportedOperationException e) {\n  LOG.error(\"Internal read unsupported for {}\", format, e);\n}","preventionTips":["Confirm the file's format before reading","Only use registered formats for internal data files","Keep the Iceberg version aligned with how files were written"],"tags":["java","unsupported-operation","file-format"],"backgroundTag":"unsupported-operation","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"}