我已经编写了一个基本的 spark 应用程序,可以按照本指南( https://github.com/datastax/spark-cassandra-connector/blob/master/doc/0_quick_start.md)读取和写入 Cassandra
这是这个应用程序的 .sbt 的样子:
name := "test Project"
version := "1.0"
scalaVersion := "2.10.5"
libraryDependencies ++= Seq(
"org.apache.spark" %% "spark-core" % "1.2.1",
"com.google.guava" % "guava" % "14.0.1",
"com.datastax.spark" %% "spark-cassandra-connector" % "1.2.1",
"org.apache.cassandra" % "cassandra-thrift" % "2.0.14",
"org.apache.cassandra" % "cassandra-clientutil" % "2.0.14",
"com.datastax.cassandra" % "cassandra-driver-core" % "2.0.14"
)
如您所见,Spark 版本是1.2.1(而不是像许多其他问题那样是 1.3.1),但是当我使用 spark-submit 运行此应用程序时,我仍然遇到错误:
WARN TaskSetManager: Lost task 1.0 in stage 0.0 (TID 1, abcdev26): java.lang.NoSuchMethodError: org.apache.spark.executor.TaskMetrics.inputMetrics_$eq(Lscala/Option;)V
at com.datastax.spark.connector.metrics.InputMetricsUpdater$.apply(InputMetricsUpdater.scala:61)
at com.datastax.spark.connector.rdd.CassandraTableScanRDD.compute(CassandraTableScanRDD.scala:196)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:277)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:244)
at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:61)
at org.apache.spark.scheduler.Task.run(Task.scala:64)
at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:203)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
我错过了什么?到目前为止,我搜索到的所有答案都建议使用我已经在做的 1.2.1。
我们欢迎所有的建议!