I am using GraphX for the first time and I want to build a Graph incrementally. So I need to connect the first two nodes to an edge knowing that I have 2 RDDs (each one has a single value):
firstRDD: RDD[((Int, Array[Int]), ((VertexId, Array[Int]), Int))]
secondRDD: RDD[((Int, Array[Int]), ((VertexId, Array[Int]), Int))]
I want to connect the first VertexId with the second one. I appreciate your help
Basically, you use
map
andcase
statements to pick out the VertexIds, then, useRDD.zip
to stitch them together, then anothermap
to create the final EdgeRDD: