在 Spark 1.6.2(Scala 2.10.5)中,以下代码在 shell 中运行良好:
为了使其起作用,现在我必须明确命名该类:
import org.apache.spark.mllib.linalg.Vector
case class DataPoint(vid: String, label: Double, features: Vector)
在mlib技术中,Vector正确地取代了Scala Vector。
然而,在Spark 2.0(Scala 2.11.8)上运行同样的代码会在shell中抛出以下错误:
<console>:11: error: type Vector takes type parameters
case class DataPoint(vid: String, label: Double, features: Vector)
为了使其起作用,现在我必须明确命名该类:
case class DataPoint(vid: String, label: Double,
features: org.apache.spark.mllib.linalg.Vector)
请问有人可以告诉我发生了什么变化,是Spark或Scala的问题吗?谢谢!