Here is the sample piece of code. I am using an array of RDDS to store objects. I would like to use flatMap on this array of RDDS and store that into a dataframe.
var ArrayofRDDs: ArrayBuffer[T] = null
for(i <- 1 to 10) {
val data = <A function that returns an object of type T>
ArrayofRDDs :+ data
}
Can someone help with how to use flatMap on the Array of RDDs?