Reputation: 45692
Is there any way to ask Spark to make partitions of equal size on coalesce
?
Stats[] stats = sparkSession
.read()
.parquet(salesPath)
.coalesce(5) // may produce partitions of 120, 1, 1, 0, 0
Upvotes: 2
Views: 1378
Reputation: 118
There is no way to have equal size partitions with coalesce
.
You should use repartition
for that.
Check out https://spark.apache.org/docs/2.2.0/rdd-programming-guide.html#transformations
Upvotes: 2