MapPartitionsRDD¶
MapPartitionsRDD is an RDD that has exactly one-to-one narrow dependency on the <
MapPartitionsRDD is <
-
PairRDDFunctions(RDD[(K, V)]) is requested to rdd:PairRDDFunctions.md#mapValues[mapValues] and rdd:PairRDDFunctions.md#flatMapValues[flatMapValues] (with the <> flag enabled) -
RDD[T]is requested to <>, < >, < >, < >, < >, < >, < >, and < > -
RDDBarrier[T]is requested to <> (with the < > flag enabled)
By default, it does not preserve partitioning -- the last input parameter preservesPartitioning is false. If it is true, it retains the original RDD's partitioning.
MapPartitionsRDD is the result of the following transformations:
filterglom- spark-rdd-transformations.md#mapPartitions[mapPartitions]
mapPartitionsWithIndex- rdd:PairRDDFunctions.md#mapValues[PairRDDFunctions.mapValues]
- rdd:PairRDDFunctions.md#flatMapValues[PairRDDFunctions.flatMapValues]
[[isBarrier_]] When requested for the rdd:RDD.md#isBarrier_[isBarrier_] flag, MapPartitionsRDD gives the <
=== [[creating-instance]] Creating MapPartitionsRDD Instance
MapPartitionsRDD takes the following to be created:
- [[prev]] Parent rdd:RDD.md[RDD] (
RDD[T]) - [[f]] Function to execute on partitions +
(TaskContext, partitionID, Iterator[T]) => Iterator[U] - [[preservesPartitioning]]
preservesPartitioningflag (default:false) - [[isFromBarrier]]
isFromBarrierflag for <> (default: false) - [[isOrderSensitive]]
isOrderSensitiveflag (default:false)