蜂巢崩溃与java.lang.IncompatibleClassChangeError

时间:2019-04-02 14:46:16

标签: hadoop hive

使用

运行“从员工选择*”时,针对Hadoop 3.2.0运行hive 3.1.1崩溃
java.lang.IncompatibleClassChangeError: Class com.google.common.collect.ImmutableSortedMap does not implement the requested interface java.util.NavigableMap

show tables之类的命令都可以正常运行,并且还可以从CLI正常加载数据。

检查了其他各种命令,例如数据已加载等。将MySQL用作带有MySQL-connector-java-5.1.47.jar的元存储。唯一的观察结果是有时候我会得到

WARN DataNucleus.MetaData: Metadata has jdbc-type of null yet this is not valid. Ignored

其他人似乎也能理解,但似乎不会在这里影响我。 有人也看到了吗?非常感谢帮助...

2019-04-02 16:24:41,643 INFO metastore.HiveMetaStore: 0: Done cleaning up thread local RawStore
2019-04-02 16:24:41,645 INFO HiveMetaStore.audit: ugi=fdai0145  ip=unknown-ip-addr      cmd=Done cleaning up thread local RawStore
Exception in thread "main" java.lang.IncompatibleClassChangeError: Class com.google.common.collect.ImmutableSortedMap does not implement the requested interface java.util.NavigableMap
        at org.apache.calcite.schema.Schemas.gatherLattices(Schemas.java:498)
        at org.apache.calcite.schema.Schemas.getLatticeEntries(Schemas.java:492)
        at org.apache.calcite.jdbc.CalciteConnectionImpl.init(CalciteConnectionImpl.java:153)
        at org.apache.calcite.jdbc.Driver$1.onConnectionInit(Driver.java:109)
        at org.apache.calcite.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:139)
        at java.sql.DriverManager.getConnection(DriverManager.java:664)
        at java.sql.DriverManager.getConnection(DriverManager.java:208)
        at org.apache.calcite.tools.Frameworks.withPrepare(Frameworks.java:150)
        at org.apache.calcite.tools.Frameworks.withPlanner(Frameworks.java:111)
        at org.apache.hadoop.hive.ql.parse.CalcitePlanner.logicalPlan(CalcitePlanner.java:1414)
        at org.apache.hadoop.hive.ql.parse.CalcitePlanner.getOptimizedAST(CalcitePlanner.java:1430)
        at org.apache.hadoop.hive.ql.parse.CalcitePlanner.genOPTree(CalcitePlanner.java:450)
        at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:12161)
        at org.apache.hadoop.hive.ql.parse.CalcitePlanner.analyzeInternal(CalcitePlanner.java:330)
        at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:285)
        at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:659)
        at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1826)
        at org.apache.hadoop.hive.ql.Driver.compileAndRespond(Driver.java:1773)
        at org.apache.hadoop.hive.ql.Driver.compileAndRespond(Driver.java:1768)
        at org.apache.hadoop.hive.ql.reexec.ReExecDriver.compileAndRespond(ReExecDriver.java:126)
        at org.apache.hadoop.hive.ql.reexec.ReExecDriver.run(ReExecDriver.java:214)
        at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:239)
        at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:188)
        at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:402)
        at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:821)
        at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:759)
        at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:683)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.hadoop.util.RunJar.run(RunJar.java:323)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:236).

1 个答案:

答案 0 :(得分:0)

也许这是一个较晚的答案,但我确实遇到了同样的问题。以我为例,我发现hive-exec Maven工件的jar文件正在遮盖Google Collections框架。现在,由于我已经看到其他Hadoop / Hive工件也使用了Google Guava(如果我没记错的话,是第11版),所以方解石很有可能会为ImmutableSortedMap找到错误的类定义(来自番石榴11)。

对我来说,将番石榴从我的代码使用的Hadoop / Hive工件中排除后,方解石就可以从Google集合中找到正确的类版本。

<dependency>
    <groupId>org.apache.hadoop</groupId>
    <artifactId>hadoop-minicluster</artifactId>
    <version>${hadoop.version}</version>
    <exclusions>
        <exclusion>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>org.apache.hive</groupId>
    <artifactId>hive-exec</artifactId>
    <version>${hive.version}</version>
    <exclusions>
        <exclusion>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>org.apache.hive</groupId>
    <artifactId>hive-jdbc</artifactId>
    <version>${hive.version}</version>
    <exclusions>
        <exclusion>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </exclusion>
    </exclusions>
</dependency>

这可能应该报告给Hive项目,因为这类类路径冲突错误很难诊断。内部阴影的工件应具有项目自己的程序包前缀,以指示所涉及的外部代码的显式阴影。

哦,很好。希望这会有所帮助。