coalesce {SparkR} | R Documentation |
Return a new RDD that is reduced into numPartitions partitions.
coalesce(x, numPartitions, ...) ## S4 method for signature 'RDD,integer' coalesce(x, numPartitions, shuffle = FALSE)
x |
The RDD. |
numPartitions |
Number of partitions to create. |
repartition
## Not run:
##D sc <- sparkR.init()
##D rdd <- parallelize(sc, list(1, 2, 3, 4, 5), 3L)
##D numPartitions(rdd) # 3
##D numPartitions(coalesce(rdd, 1L)) # 1
## End(Not run)