pyspark.streaming.DStream.mapPartitionsWithIndex#

DStream.mapPartitionsWithIndex(f, preservesPartitioning=False)[source]#

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