QuestionQ187

VerifiedTroubleshooting and Tuning Apache Spark DataFrame API Applications.

A data engineer finds that a Spark application is running slowly due to a large number of small tasks resulting from too many partitions in a DataFrame.

How can the data engineer decrease the number of partitions to improve performance without triggering a full shuffle?

Explanation

coalesce() reduces a DataFrame to a lower number of partitions through a narrow dependency, combining existing partitions without a shuffle. repartition() redistributes data and adds a shuffle step.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!