nerdexam
Databricks

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.

Spark Core Concepts and Architecture

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)
  • B
    88% (21)
  • C
    8% (2)
  • E
    4% (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.

ANone of these options describe lazy evaluation

Option B is a valid and accurate description of lazy evaluation, so this choice is incorrect.

BA process is lazily evaluated if its execution does not start until it is put into action by some type ofCorrect

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.

CA process is lazily evaluated if its execution does not start until it is forced to display a result to

Restricting lazy evaluation to displaying results is too narrow - any action (not just display operations) triggers execution.

DA process is lazily evaluated if its execution does not start until it reaches a specified date and

Lazy evaluation has nothing to do with a scheduled date or time - it is triggered by calling an action in code.

EA process is lazily evaluated if its execution does not start until it is finished compiling

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

#Lazy Evaluation#Spark Architecture#Execution Model#Transformations and Actions

Community Discussion

No community discussion yet for this question.

Full DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK Practice