QuestionQ64

VerifiedCost & Performance Optimisation

A user who is new to Databricks is attempting to troubleshoot long execution times for some pipeline logic they are developing. Currently, the user executes code one cell at a time, using display() calls to verify that code produces logically correct results as new transformations are added to an operation. To measure average execution time, the user runs every cell interactively multiple times.

Which of the following changes will provide a more accurate measure of how the code is likely to perform in production?

Explanation

Spark transformations are lazy: they build a logical query plan and are executed only when an action requires results. A display() call materializes results and triggers execution, so placing it between transformations prevents Spark from optimizing and executing the complete pipeline as one plan. Repeated interactive runs can also be accelerated by cached data, making those timings unrepresentative of production execution.

Learn more

Community Discussion

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