tabular-io / iceberg-rest-image

Simple project to expose a catalog over REST using a Java catalog backend
Apache License 2.0
100 stars 40 forks source link

No NessieCatalog? #9

Closed Cerebus closed 1 year ago

Cerebus commented 1 year ago

Setting CATALOG_IO__IMPL=org.apache.iceberg.nessie.NessieCatalog throws an exception immediately at startup:

2023-01-18T15:54:22.583 INFO  [org.apache.iceberg.CatalogUtil] - Loading custom FileIO implementation: org.apache.iceberg.nessie.NessieCatalog
Exception in thread "main" java.lang.IllegalArgumentException: Cannot initialize FileIO, missing no-arg constructor: org.apache.iceberg.nessie.NessieCatalog
        at org.apache.iceberg.CatalogUtil.loadFileIO(CatalogUtil.java:311)
        at org.apache.iceberg.jdbc.JdbcCatalog.initialize(JdbcCatalog.java:101)
        at org.apache.iceberg.CatalogUtil.loadCatalog(CatalogUtil.java:238)
        at org.apache.iceberg.CatalogUtil.buildIcebergCatalog(CatalogUtil.java:283)
        at org.apache.iceberg.rest.RESTCatalogServer.backendCatalog(RESTCatalogServer.java:83)
        at org.apache.iceberg.rest.RESTCatalogServer.main(RESTCatalogServer.java:87)
Caused by: java.lang.NoSuchMethodException: Cannot find constructor for interface org.apache.iceberg.io.FileIO
        Missing org.apache.iceberg.nessie.NessieCatalog [java.lang.ClassNotFoundException: org.apache.iceberg.nessie.NessieCatalog]
        at org.apache.iceberg.common.DynConstructors.buildCheckedException(DynConstructors.java:250)
        at org.apache.iceberg.common.DynConstructors.access$200(DynConstructors.java:32)
        at org.apache.iceberg.common.DynConstructors$Builder.buildChecked(DynConstructors.java:220)
        at org.apache.iceberg.CatalogUtil.loadFileIO(CatalogUtil.java:308)
        ... 5 more
        Suppressed: java.lang.ClassNotFoundException: org.apache.iceberg.nessie.NessieCatalog
                at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
                at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
                at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
                at java.base/java.lang.Class.forName0(Native Method)
                at java.base/java.lang.Class.forName(Class.java:467)
                at org.apache.iceberg.common.DynConstructors$Builder.impl(DynConstructors.java:149)
                at org.apache.iceberg.CatalogUtil.loadFileIO(CatalogUtil.java:307)
                ... 5 more
Cerebus commented 1 year ago

CATALOG_CATALOG__IMPL does the same.

Cerebus commented 1 year ago

OK, changed up the gradle runtime dependencies and rerolled the container, so all good here, but consider this for next version. :)

nastra commented 1 year ago

CATALOG_IO__IMPL is for specifying a custom FileIO implementation, not a particular catalog. Also the REST image doesn't provide any Nessie server dependencies, so you would have to get and run the Nessie server from https://github.com/projectnessie/nessie/releases