apache / iceberg

Apache Iceberg
https://iceberg.apache.org/
Apache License 2.0
6.4k stars 2.21k forks source link

NoClassDefFoundError: org/apache/iceberg/relocated/com/google/common/collect/Maps #1719

Closed HeChuanXUPT closed 3 years ago

HeChuanXUPT commented 3 years ago

env:

ref: https://github.com/apache/iceberg/blob/master/site/docs/flink.md

I build iceberg-flink-0.10.0.jar from tag apache-iceberg-0.10.0-rc0 sql-client crashed with iceberg-flink-0.10.0.jar when create catalog, then I try the jar build from master branch, display the same error message

./bin/sql-client.sh embedded -j ./iceberg-flink-0.10.0.jar -j ./flink-sql-connector-hive-3.1.2_2.12-1.11.2.jar shell CREATE CATALOG hive_catalog WITH ( 'type'='iceberg', 'catalog-type'='hive', 'uri'='thrift://127.0.0.1:9083' );

Exception in thread "main" org.apache.flink.table.client.SqlClientException: Unexpected exception. This is a bug. Please consider filing an issue.
 at org.apache.flink.table.client.SqlClient.main(SqlClient.java:213)
Caused by: java.lang.NoClassDefFoundError: org/apache/iceberg/relocated/com/google/common/collect/Maps
 at org.apache.iceberg.flink.FlinkCatalogFactory.requiredContext(FlinkCatalogFactory.java:101)
 at org.apache.flink.table.factories.TableFactoryService.normalizeContext(TableFactoryService.java:365)
 at org.apache.flink.table.factories.TableFactoryService.filterByContext(TableFactoryService.java:260)
 at org.apache.flink.table.factories.TableFactoryService.filter(TableFactoryService.java:190)
 at org.apache.flink.table.factories.TableFactoryService.findSingleInternal(TableFactoryService.java:143)
 at org.apache.flink.table.factories.TableFactoryService.find(TableFactoryService.java:113)
 at org.apache.flink.table.api.internal.TableEnvironmentImpl.createCatalog(TableEnvironmentImpl.java:1080)
 at org.apache.flink.table.api.internal.TableEnvironmentImpl.executeOperation(TableEnvironmentImpl.java:1019)
 at org.apache.flink.table.api.internal.TableEnvironmentImpl.executeSql(TableEnvironmentImpl.java:690)
 at org.apache.flink.table.client.gateway.local.LocalExecutor.lambda$executeSql$7(LocalExecutor.java:360)
 at org.apache.flink.table.client.gateway.local.ExecutionContext.wrapClassLoader(ExecutionContext.java:255)
 at org.apache.flink.table.client.gateway.local.LocalExecutor.executeSql(LocalExecutor.java:360)
 at org.apache.flink.table.client.cli.CliClient.callDdl(CliClient.java:642)
 at org.apache.flink.table.client.cli.CliClient.callDdl(CliClient.java:637)
 at org.apache.flink.table.client.cli.CliClient.callCommand(CliClient.java:357)
 at java.util.Optional.ifPresent(Optional.java:159)
 at org.apache.flink.table.client.cli.CliClient.open(CliClient.java:212)
 at org.apache.flink.table.client.SqlClient.openCli(SqlClient.java:142)
 at org.apache.flink.table.client.SqlClient.start(SqlClient.java:114)
 at org.apache.flink.table.client.SqlClient.main(SqlClient.java:201)
Caused by: java.lang.ClassNotFoundException: org.apache.iceberg.relocated.com.google.common.collect.Maps
 at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
 at org.apache.flink.util.FlinkUserCodeClassLoader.loadClassWithoutExceptionHandling(FlinkUserCodeClassLoader.java:61)
 at org.apache.flink.util.ChildFirstClassLoader.loadClassWithoutExceptionHandling(ChildFirstClassLoader.java:74)
 at org.apache.flink.util.FlinkUserCodeClassLoader.loadClass(FlinkUserCodeClassLoader.java:48)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
 ... 20 more

Shutting down the session...
done.
openinx commented 3 years ago

./bin/sql-client.sh embedded -j ./iceberg-flink-0.10.0.jar -j ./flink-sql-connector-hive-3.1.2_2.12-1.11.2.jar shell

I think you've loaded the wrong iceberg-flink jar, iceberg-flink-runtime-0.10.0 is the correct one.

HeChuanXUPT commented 3 years ago

./bin/sql-client.sh embedded -j ./iceberg-flink-0.10.0.jar -j ./flink-sql-connector-hive-3.1.2_2.12-1.11.2.jar shell

I think you've loaded the wrong iceberg-flink jar, iceberg-flink-runtime-0.10.0 is the correct one.

My fault 😞