Error while running hive tpch-setup: java.lang.IllegalAccessError: class org.apache.hadoop.hdfs.web.HftpFileSystem cannot access its superinterface

Error while running hive tpch-setup: java.lang.IllegalAccessError: class org.apache.hadoop.hdfs.web.HftpFileSystem cannot access its superinterface

我正在按照 https://github.com/hortonworks/hive-testbench.git 的说明尝试 运行 配置 tpcdh。我 运行 遇到以下错误。 tpcds-setup 未发现此问题。

这不适用于 CDP 试用版 7.3.1,CDH 版本:Cloudera Enterprise 6.3.4,但适用于 Apache Ambari 版本 2.6.2.2

[tech_mach hive-testbench]# ./tpch-setup.sh 3
+ hadoop jar target/tpch-gen-1.0-SNAPSHOT.jar -d /tmp/tpch-generate/3/ -s 3
WARNING: Use "yarn jar" to launch YARN applications.
Exception in thread "main" java.lang.IllegalAccessError: class org.apache.hadoop.hdfs.web.HftpFileSystem cannot access its superinterface org.apache.hadoop.hdfs.web.TokenAspect$TokenManagementDelegator
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
    at java.net.URLClassLoader.access0(URLClassLoader.java:73)
    at java.net.URLClassLoader.run(URLClassLoader.java:368)
    at java.net.URLClassLoader.run(URLClassLoader.java:362)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:348)
    at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:370)
    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
    at java.util.ServiceLoader.next(ServiceLoader.java:480)
    at org.apache.hadoop.fs.FileSystem.loadFileSystems(FileSystem.java:3337)
    at org.apache.hadoop.fs.FileSystem.getFileSystemClass(FileSystem.java:3382)
    at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:3422)
    at org.apache.hadoop.fs.FileSystem.access0(FileSystem.java:158)
    at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:3485)
    at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:3453)
    at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:518)
    at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:266)
    at org.notmysock.tpch.GenTable.genInput(GenTable.java:171)
    at org.notmysock.tpch.GenTable.run(GenTable.java:98)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76)
    at org.notmysock.tpch.GenTable.main(GenTable.java:54)
    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:318)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:232)
+ hdfs dfs -ls /tmp/tpch-generate/3/lineitem
ls: `/tmp/tpch-generate/3/lineitem': No such file or directory
+ '[' 1 -ne 0 ']'
+ echo 'Data generation failed, exiting.'
Data generation failed, exiting.
+ exit 1

在 hive-testbench/tpch-gen/pom.xml 中,更改了 hadoop 版本,问题得到解决

<dependencies>
  <dependency>
    <groupId>org.apache.hadoop</groupId>
    <artifactId>hadoop-client</artifactId>
    <version>2.4.0</version>
    <scope>compile</scope>
  </dependency>
 ```