当前位置:   article > 正文

Spark报错:Unable to instantiate SparkSession with Hive support because Hive classes are not found

unable to instantiate sparksession with hive support because hive classes ar

现象

用IDEA写Spark,在初始化SparkSession时,设置enableHiveSupport()报错
,报错信息为Unable to instantiate SparkSession with Hive support because Hive classes are not found.

SparkSession sc = SparkSession
                .builder()
                .master("local[*]")
                .appName("Test")
                .enableHiveSupport()
                .getOrCreate();
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

原因

pom没有引入支持对Hive的依赖

解决

在pom文件内添加如下依赖:

<dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-hive_2.11</artifactId>
            <version>${spark.version}</version>  //我的版本是2.1.0
</dependency>
  • 1
  • 2
  • 3
  • 4
  • 5

参考链接

Unable to instantiate SparkSession with Hive support because Hive classes are not found.

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小舞很执着/article/detail/869707
推荐阅读
相关标签
  

闽ICP备14008679号