val partRDD = parallel.mapPartitionsWithIndex((index: Int, it: Iterator[Int]) => if(index == idx) it else Iterator(), true)
val data = partRDD.collect
// Data contains all values from a single partition in the form of array.
// Now you can do with the data whatever you want: iterate, save to a file, etc.
// You can use also the foreachPartition operation
parallel.foreachPartition(partition => {