赞
踩
用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();
pom没有引入支持对Hive的依赖
在pom文件内添加如下依赖:
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-hive_2.11</artifactId>
<version>${spark.version}</version> //我的版本是2.1.0
</dependency>
Unable to instantiate SparkSession with Hive support because Hive classes are not found.
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。