In Spark Scala framework, I have an RDD, rdd1, in which each element represents a single element of a matrix A:
val rdd1 = dist.map{case (((x,y),z,v)) => ((x,y),v)}
x represents the row,
y represents the column and
v represents the value in matrix A.
I also have another RDD, rdd2, in the form of RDD[index, Array[(x, y)]] where the array in each element represents the set of elements of the matrix A, which are stored in rdd1, needed for the specific index represented in that element.
Now what I need to do, is get the values of the matrix A elements for each index, preserving all data including index, (x,y) and v. What would be a good approach in doing this ?