无法示例化sparksession

ltqd579y  于 2021-05-27  发布在  Spark
关注(0)|答案(0)|浏览(298)

我尝试用spark和hive配置hadoop集群。
我在hive3.1.3中使用hadoop3.1.3版本,在用户提供的hadoop中使用prebuildspark3.0.0版本。
当我全部部署时,我不应该从spark连接到hive元存储。所以,我尝试了这个,并得到以下

./bin/run-example sql.hive.SparkHiveExample

输出:

Exception in thread "main" java.lang.IllegalArgumentException: Unable to instantiate SparkSession with Hive support because Hive classes are not found.
    at org.apache.spark.sql.SparkSession$Builder.enableHiveSupport(SparkSession.scala:871)
    at org.apache.spark.examples.sql.hive.SparkHiveExample$.main(SparkHiveExample.scala:47)
    at org.apache.spark.examples.sql.hive.SparkHiveExample.main(SparkHiveExample.scala)
    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.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)
    at org.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:928)
    at org.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)
    at org.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)
    at org.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)
    at org.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1007)
    at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1016)
    at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
20/07/06 15:26:27 INFO ShutdownHookManager: Shutdown hook called
20/07/06 15:26:28 INFO ShutdownHookManager: Deleting directory /tmp/spark-246ae724-072f-45b1-9c89-cf122203a3df

我在这里设置了类路径
我该怎么做才能成功链接spark和hive?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题