使用$hive\u metastore\u jars指定正确配置单元jar的有效路径,或将spark.sql.hive.metastore.version更改为1.2.1

kq4fsx7k  于 2021-06-02  发布在  Hadoop
关注(0)|答案(1)|浏览(387)

当我尝试在包含hivecontext的jar上运行spark submit时,得到以下错误。
spark-defaults.conf文件

spark.sql.hive.metastore.version 0.14.0
spark.sql.hive.metastore.jars ----/external_jars/hive-metastore-0.14.0.jar

# spark.sql.hive.metastore.jars maven

我想使用配置单元元存储版本0.14。spark和hadoop都在diff集群上。
有人能帮我解决这个问题吗?
16/09/19 16:52:24信息hivecontext:默认仓库位置为/apps/hive/warehouse exception in thread“main”java.lang.illegalargumentexception:只有当配置单元执行版本==配置单元元存储版本时,才能使用内置jar。执行:1.2.1!=元存储:0.14.0。使用$hive\u metastore\u jars指定正确配置单元jar的有效路径,或将spark.sql.hive.metastore.version更改为1.2.1。在org.apache.spark.sql.hive.hivecontext.metadatahive$lzycompute(hivecontext。scala:254)位于org.apache.spark.sql.hive.hivecontext.metadatahive(hivecontext)。scala:237)在org.apache.spark.sql.hive.hivecontext.setconf(hivecontext。scala:441)在org.apache.spark.sql.sqlcontext$$anonfun$4.apply(sqlcontext。scala:272)在org.apache.spark.sql.sqlcontext$$anonfun$4.apply(sqlcontext。scala:271)在scala.collection.iterator$class.foreach(iterator。scala:727)在scala.collection.abstractiterator.foreach(迭代器。scala:1157)在scala.collection.iterablelike$cla

pxy2qtax

pxy2qtax1#

尝试

val hadoopConfig: Configuration = spark.hadoopConfiguration 
hadoopConfig.set("fs.hdfs.impl", classOf[org.apache.hadoop.hdfs.DistributedFileSystem].getNam‌​e) 
hadoopConfig.set("fs.file.impl", classOf[org.apache.hadoop.fs.LocalFileSystem].getName)

在Spark中

相关问题