repartition,DataFrame,numeric-method {SparkR}R Documentation

Repartition

Description

Return a new DataFrame that has exactly numPartitions partitions.

Usage

## S4 method for signature 'DataFrame,numeric'
repartition(x, numPartitions)

Arguments

x

A SparkSQL DataFrame

numPartitions

The number of partitions to use.

Examples

## Not run: 
##D sc <- sparkR.init()
##D sqlContext <- sparkRSQL.init(sc)
##D path <- "path/to/file.json"
##D df <- jsonFile(sqlContext, path)
##D newDF <- repartition(df, 2L)
## End(Not run)

[Package SparkR version 1.4.0 Index]