lapplyPartition {SparkR} | R Documentation |
Return a new RDD by applying a function to each partition of this RDD.
mapPartitions is the same as lapplyPartition.
lapplyPartition(X, FUN) ## S4 method for signature 'RDD,'function'' lapplyPartition(X, FUN) mapPartitions(X, FUN) ## S4 method for signature 'RDD,'function'' mapPartitions(X, FUN)
X |
The RDD to apply the transformation. |
FUN |
the transformation to apply on each partition. |
a new RDD created by the transformation.
## Not run:
##D sc <- sparkR.init()
##D rdd <- parallelize(sc, 1:10)
##D partitionSum <- lapplyPartition(rdd, function(part) { Reduce("+", part) })
##D collect(partitionSum) # 15, 40
## End(Not run)