pyspark.streaming.DStream.mapPartitionsWithIndexΒΆ

DStream.mapPartitionsWithIndex(f: Callable[[int, Iterable[T]], Iterable[U]], preservesPartitioning: bool = False) β†’ pyspark.streaming.dstream.DStream[U][source]ΒΆ

Return a new DStream in which each RDD is generated by applying mapPartitionsWithIndex() to each RDDs of this DStream.