QuestionQ221

VerifiedCost & Performance Optimisation

While examining a query’s execution in the Deatricks Query Profile, a data engineer sees that the “Top operators” panel lists a sort operator with high “Time spent” and “Memory peak” metrics, while the Spark UI shows frequent data spilling.

How should the data engineer address this issue?

Explanation

Sorts consume Spark execution memory and can spill when individual shuffle tasks receive more data than they can process in memory. Raising the number of shuffle partitions distributes the shuffle workload across more tasks, reducing the amount of data and memory required per task. Apache Spark recommends increasing parallelism when a task working set is too large.

Learn more

Community Discussion

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