> For the complete documentation index, see [llms.txt](https://george-jen.gitbook.io/data-science-and-apache-spark/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://george-jen.gitbook.io/data-science-and-apache-spark/repartition-numpartitions.md).

# repartition(numPartitions)

### repartition(numPartitions)

Changes the level of parallelism in this DStream by creating more or fewer partitions.

```
//Default partition is number of CPU "cores (threads really)" in the machine that runs Spark
getSomeData.rdd.getNumPartitions
val rePartition = getSomeData.repartition(numPartitions = 6)
```
