Can coalesce increase the number of partitions?
1Times asked
Jul 2026Last seen
Jul 2026First seen
💡 Model Answer
No. The coalesce transformation in Spark is designed to reduce the number of partitions by collapsing adjacent partitions without performing a full shuffle. It is efficient for shrinking the partition count, for example when you want to reduce the number of output files. If you need to increase the number of partitions, you should use repartition, which performs a shuffle to redistribute data across the new partitions.
This answer was generated by AI for study purposes. Use it as a starting point — personalize it with your own experience.
🎤 Get questions like this answered in real-time
Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers on a discreet on-screen overlay.
Get Assisting AI — Starts at ₹500