2

I am using spark 1.4.0 and graphx and I have my graph edges stored in file and I use the following lines of code to store them in an RDD. I would like to use EdgeRDD instead of RDD[Edge[String]]

val edges: RDD[Edge[String]] = edge_file.map(line => {val x = line.split("\\s+")
Edge(x(0).toLong, x(1).toLong, " "); })

I tried this

val edgesRDD = EdgeRDD(edges)

How can I solve this.

SanS
  • 385
  • 8
  • 21

1 Answers1

3

EdgeRDD.fromEdges(edges) should do the trick.

zero323
  • 322,348
  • 103
  • 959
  • 935