I have an RDD with each entry of the format (Long, Array[Double]). For example:
val A = sc.parallelize( [(0, [5.0, 8.3]), (1, [4.2, 1.2])] )
I want to transform A to the form:
[(0, 0, 5.0), (0, 1, 8.3), (1, 0, 4.2), (1, 1, 1.2)],
where the second element in the tuple is the index of the value from the array.