QuestionQ10

VerifiedCost & Performance Optimisation

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

Which adjustment will provide a more accurate measurement of how the code is likely to perform in production?

Explanation

Apache Spark evaluates transformations lazily and can optimize a chain of transformations together when an action triggers computation. display() is an action that forces a job, so placing it between transformations interrupts production-like optimization. Repeated interactive runs can also read cached data, producing timings that do not represent a fresh production execution.

Learn more

Community Discussion

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