coalesce {SparkR}R Documentation

Return a new RDD that is reduced into numPartitions partitions.

Description

Return a new RDD that is reduced into numPartitions partitions.

Usage

coalesce(x, numPartitions, ...)

## S4 method for signature 'RDD,integer'
coalesce(x, numPartitions, shuffle = FALSE)

Arguments

x

The RDD.

numPartitions

Number of partitions to create.

See Also

repartition

Examples

## 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)

[Package SparkR version 0.1 Index]