Skip to content

FormatModelRegistry init fails when iceberg-orc is absentΒ #16720

Description

@shihadaf

Apache Iceberg version

1.11.0 (latest release)

Query engine

None

Please describe the bug 🐞

GenericFormatModels.register() references org.apache.iceberg.orc.OrcRowWriter as a class literal. When iceberg-orc is absent, the JVM throws NoClassDefFoundError (an Error). DynMethods.invoke() rethrows Error directly, bypassing the catch, so <clinit> fails and permanently poisons FormatModelRegistry for the classloader's lifetime.

Stack trace:

Caused by: java.lang.NoClassDefFoundError: org/apache/iceberg/orc/OrcRowWriter
    at org.apache.iceberg.data.GenericFormatModels.register(GenericFormatModels.java:55)
    at org.apache.iceberg.formats.FormatModelRegistry.registerSupportedFormats(FormatModelRegistry.java:207)
    at org.apache.iceberg.formats.FormatModelRegistry.<clinit>(FormatModelRegistry.java:69)
Caused by: java.lang.ClassNotFoundException: org.apache.iceberg.orc.OrcRowWriter

Maybe need to widen the catch in `registerSupportedFormats()`?

### Willingness to contribute

- [ ] I can contribute a fix for this bug independently
- [ ] I would be willing to contribute a fix for this bug with guidance from the Iceberg community
- [ ] I cannot contribute a fix for this bug at this time

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions