火花单元测试与蜂巢对局部Metastore

时间:2017-09-30 13:21:15

标签: scala apache-spark apache-spark-sql datanucleus

我使用spark 2.2.0,我想为hive支持创建spark的单元测试。 测试应该在存储在本地磁盘上的Metastore上进行中继(如programming guide中所述)

我按以下方式定义会话:

val spark = SparkSession
 .builder
 .config(conf)
 .enableHiveSupport()
 .getOrCreate()

火花会话的创建失败,错误:

org.datanucleus.exceptions.NucleusUserException: Persistence process has been specified to use a ClassLoaderResolver of name "datanucleus" yet this has not been found by the DataNucleus plugin mechanism. Please check your CLASSPATH and plugin specification.

我设法通过添加以下依赖项来解决此错误:

"org.datanucleus" % "datanucleus-accessplatform-jdo-rdbms" % "3.2.9"

这对我来说很奇怪,因为这个库已经包含在spark中了。

还有另一种解决方法吗? 我不会跟踪图书馆并用每个新的火花版本更新它。

0 个答案:

没有答案