scala - 错误图 X 引起:java.lang.NoSuchMethodError: scala.Product.$init$(Lscala/Product;)V
问题描述
我一直在玩使用类,但是当我尝试实现它们时,我不断收到上面的错误。这是我的代码:
import org.apache.spark.graphx._
import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}
class EdgeProperties()
case class WriterWriterProperties(weight: String, edgeType: String) extends EdgeProperties
object GraphXAnalysis2 {
val edgeWeightedWriterWriterCollaborated = "in/Graphs/Graph4_WriterWriter/EdgesWeightedWriterWriter_writerscollaborated.csv"
val vertexWriterWriter = "in/Graphs/Graph4_WriterWriter/Vertices.csv"
val conf = new SparkConf().setAppName("Music Graph Application").setMaster("local[1]")
val sc = new SparkContext(conf)
val WriterWriter: RDD[(VertexId, String)] = sc.textFile(vertexWriterWriter).map {
line =>
val row = line.split(",")
(row(0).toLong, row(2))
}
val edgesWriterWriterCollaborated: RDD[Edge[EdgeProperties]] = sc.textFile(edgeWeightedWriterWriterCollaborated).map {
line =>
val row = line.split(",")
Edge(row(0).toLong, row(1).toLong, WriterWriterProperties(row(2), row(3)): EdgeProperties)
}
val graph4 = Graph(WriterWriter, edgesWriterWriterCollaborated)
我是错误地声明了课程,错误地使用了它还是将它放在了错误的位置?非常感谢你,因为我对此完全陌生。
解决方案
推荐阅读
- mongodb - 无法在 openshift 中部署 mongodb 社区运营商
- flutter - 页面授权令牌
- c++ - 可以为 64 位目标使用 GCC“--enable-frame-pointer”
- reactjs - Gridjs-react:按具有 React 组件的列排序
- swift - 我怎么能在初始化期间失败?
- javascript - 如何在 GET 响应中显示数组中的特定元素
- python - Django 联系电子邮件表单未在模板 home.html 中呈现/显示
- reactjs - 为什么 http 代理中间件在 React 中不起作用?
- json - 如何处理 Liquid 模板中的 json 字典?
- c - 最内层的括号是否首先在 C 中求值?