SPARK-3604. Replace the map call in UnionRDD#getPartitions method to avo...

...id creating an additional Seq.