I have an RDD in the form RDD[((ID, code),value)]
Example RDD:
((00001, 234) 7.0)
((00001, 456) 6.0)
((00001, 467) 3.0)
((00002, 245) 8.0)
((00002, 765) 9.0)
...
The Expected result RDD[String, Vectors.dense(...))
Example:
(00001, vector(7.0, 6.0, 3.0))
(00002, vector(8.0, 9.0))
I have tried the following:
val vectRDD = InRDD.groupBy(f => f._1._1)
.map(m => (m._1, Vectors.dense(m._2._2)))
But get the below error:
value _2 is not a member of Iterable
Suggestions?