QuestionQ220

VerifiedCost & Performance Optimisation

The following code was migrated from a legacy workload into a Databricks notebook:

Question Image

The code runs successfully and returns logically correct results; however, extracting and loading approximately 1 GB of data takes more than 20 minutes.

Which statement could explain this behavior?

Explanation

The %sh magic command runs shell code only on the Databricks driver node, not on Spark worker nodes. Consequently, the script execution and file movement shown run without distributed Spark processing, so the workload can be correct but slow for a 1 GB extract-and-load operation.

Learn more

Community Discussion

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