2017-02-19 196 views
0

我尝试用火花SQL工作,但我有以下错误:星火SQL错误

error: missing or invalid dependency detected while loading class file 'package.class'. Could not access term annotation in package org.apache.spark, because it (or its dependencies) are missing. Check your build definition for missing or conflicting dependencies. (Re-run with -Ylog-classpath to see the problematic classpath.) A full rebuild may help if 'package.class' was compiled against an incompatible version of org.apache.spark. warning: Class org.apache.spark.annotation.InterfaceStability not found - continuing with a stub. error: missing or invalid dependency detected while loading class file 'SparkSession.class'. Could not access term annotation in package org.apache.spark, because it (or its dependencies) are missing. Check your build definition for missing or conflicting dependencies. (Re-run with -Ylog-classpath to see the problematic classpath.) A full rebuild may help if 'SparkSession.class' was compiled against an incompatible version of org.apache.spark.

我的配置:

  • 斯卡拉2.11.8
  • 火花core_2.11 -2.1.0
  • 火花sql_2.11-2.1.0

  • 注意:我使用SparkSession。

+0

你能分享你是怎么解决这个问题? –

+0

@YashSharma,我JUSTE使用SBT工具并投入build.sbt:libraryDependencies ++ = SEQ( \t “org.apache.spark” %% “火花芯” % “2.1.0” % “提供”, \t“org.apache.spark”%%“spark-sql”%“2.1.0”%“provided”) –

回答

3

您需要包括以下项目,以避免依赖问题。

  • 火花unsafe_2.11-2.1.1
  • 火花tags_2.11-2.1.1