You shouldn't have to fly data around

You can just run it first on partition 0, then on partition 1, etc...  I
may have the name slightly off, but something approximately like:

for (p <- 0 until numPartitions)
  data.mapPartitionsWithIndex((i, iter) => if (0 == p) iter.map(fcn) else
List().iterator)

should work... BUT that being said, you've now really lost the point of
using Spark to begin with.

Reply via email to