抽样。
mapPartitionsWithSplit
返回一个新的抽样的抽样函数应用到每个分区,同时跟踪原始分区的索引。
使用RDD.mapPartitionsWithIndex ()代替。
RDD.mapPartitionsWithIndex ()
例子
> > >抽样=sc。并行化([1,2,3,4),4)> > >deff(splitIndex,迭代器):收益率splitIndex> > >抽样。mapPartitionsWithSplit(f)。总和()6
以前的
pyspark.RDD.mapPartitionsWithIndex
下一个
pyspark.RDD.mapValues