2016-03-23 17 views
2

我一直在试图让spark-submit与org.apache.spark.sql.hive.HiveContext一起工作,但我一直使用java.lang.NoClassDefFoundError:org/apache/tez/dag/api/SessionNotRunning 。下面是代码,它打破的最后一行:如何让火线提交配置单元和tez线正确运行?

val sc = SparkContext.getOrCreate() 
val sqlContext = new org.apache.spark.sql.hive.HiveContext(sc) 

这是Hortonworks 2.3.4,火花1.5.2,1.2.1蜂箱,Hadoop的2.7.1和0.7.0 TEZ。我使用除数据核外的所有依赖项的maven,我在spark-submit的--files参数中有hive-site.xml和tez-site.xml。这里是我的朋友的tez相关摘录:

<dependency> 
     <groupId>org.apache.tez</groupId> 
     <artifactId>tez-api</artifactId> 
     <version>${tez.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.tez</groupId> 
     <artifactId>tez-dag</artifactId> 
     <version>${tez.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.tez</groupId> 
     <artifactId>tez-common</artifactId> 
     <version>${tez.version}</version> 
    </dependency> 

此代码在火狐外壳中正常工作。有什么建议?

+1

我无法理解,因为您使用的是Spark,为什么要使用tez?即使使用HiveContext,Spark也可以独自完成所有工作。 – user1314742

+0

@ user1314742, 我并不特意尝试使用tez。来自hive-site.xml的exection引擎在我们的集群上是tez。我添加了依赖关系来试图摆脱错误。 – RachmaninovQuartet

+0

因此,将新的hive-site.xml放入您的spark conf目录,并尝试删除tez并重试..应解决问题 – user1314742

回答

1

按照@ user1314742的建议,我从hive-site.xml中删除了与tez相关的所有东西。我将它包含在spark-submit的--files参数中,以免更改我的实际配置单元。

So put new hive-site.xml into your spark conf directory and try to remove tez and try again.. that should resolve the problem

相关问题