0
val degrees: VertexRDD[Int] = graph.degrees
val ngb=graph.collectNeighbors(EdgeDirection.Out)
val deg2 = degrees.leftOuterJoin(ngb)

Now i want a key/value pair RDD where key is degree and value is neighbor vertex id. Basically i want to change from (id,Array[1,2,3]) to {(id,1)(id,2)(id,3)}

I have tried nested map and creating a string for the outer map. I am stuck here. If anyone can help. Thanks in advance.

user2871856
  • 227
  • 2
  • 3
  • 11

1 Answers1

1

Sorry, got it myself. Did flatMap(y => y) with identity function. It was so simple.

user2871856
  • 227
  • 2
  • 3
  • 11