repartition(numPartitions)

repartition(numPartitions)

Changes the level of parallelism in this DStream by creating more or fewer partitions.
1
//Default partition is number of CPU "cores (threads really)" in the machine that runs Spark
2
getSomeData.rdd.getNumPartitions
3
val rePartition = getSomeData.repartition(numPartitions = 6)
Copied!
​
Last modified 1yr ago
Copy link