FormatModelRegistry init fails when iceberg-orc is absent
- Dominant language
- Java
- Stars
- 9.2k
- Forks
- 3.5k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 132
Description
### 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 `` 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.(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
Contributor guide
Assessment
This issue has not been assessed yet.