Description Usage Arguments Examples
Repartitions a spark_tbl. Optionally allos for vector of columns to be used for partitioning.
1 | repartition(.data, n_partitions, partition_by)
|
.data |
a data frame to be repartitioned |
n_partitions |
integer, the target number of partitions |
partition_by |
vector of column names used for partitioning, only supported for Spark 2.0+ |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
spark_session()
df <- spark_tbl(mtcars)
df %>% n_partitions() # 1
df_repartitioned <- df %>% repartition(5)
df %>% n_partitions() # 5
df_repartitioned <- df %>% repartition(5, c("cyl"))
spark_session_stop()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.