DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK · Question #127
Which of the following is the most complete description of lazy evaluation?
The correct answer is B. A process is lazily evaluated if its execution does not start until it is put into action by some type of. Lazy evaluation in Spark means that transformations are not executed immediately when defined - execution is deferred until an action triggers the computation.
Question
Which of the following is the most complete description of lazy evaluation?
Options
- ANone of these options describe lazy evaluation
- BA process is lazily evaluated if its execution does not start until it is put into action by some type of
- CA process is lazily evaluated if its execution does not start until it is forced to display a result to
- DA process is lazily evaluated if its execution does not start until it reaches a specified date and
- EA process is lazily evaluated if its execution does not start until it is finished compiling
How the community answered
(24 responses)- B88% (21)
- C8% (2)
- E4% (1)
Why each option
Lazy evaluation in Spark means that transformations are not executed immediately when defined - execution is deferred until an action triggers the computation.
Option B is a valid and accurate description of lazy evaluation, so this choice is incorrect.
In Spark, calling transformations like map(), filter(), or select() records the operation in a logical plan but does not execute it. Execution begins only when an action - such as collect(), count(), or show() - is called, which puts the plan 'into action.' This allows Spark to optimize the full execution plan before running any computation.
Restricting lazy evaluation to displaying results is too narrow - any action (not just display operations) triggers execution.
Lazy evaluation has nothing to do with a scheduled date or time - it is triggered by calling an action in code.
Lazy evaluation is not related to compilation completion - Spark code compiles eagerly, but execution of the data pipeline is deferred.
Concept tested: Spark lazy evaluation and action vs transformation
Source: https://spark.apache.org/docs/latest/rdd-programming-guide.html#rdd-operations
Topics
Community Discussion
No community discussion yet for this question.