what is the benefit of repartition 1 and coalesce 1 When we save data we use df repartition 1 so how many partition it will create

–1 vote
what is the benefit of repartition(1) and coalesce(1). When we save data we use df.repartition(1).so how many partition it will create
Jul 26, 2019 in Apache Spark by kumar Ma
• 6,733 views
In case you use .repartition(1) it will only create a single file per partition. the main benefit is, the less the number of file per partition, the higher the reading speed will be. However if the file size becomes more than or almost a GB, then better to go for 2nd partition like .repartition(2).

In case or repartition all data gets re shuffled. and all the files under a partition have almost same size.

by using coalesce you can just reduce the amount of Data being shuffled.

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Apache Spark

0 votes