What is the purpose of 'lazy evaluation' in Spark?

Answer

To delay computation until an action is performed

Explanation

Spark uses lazy evaluation, meaning transformations (like map, filter) are not executed immediately. Instead, they build a Directed Acyclic Graph (DAG) of operations, and computation only occurs when an action (like count, collect, save) is called.

Last reviewed: October 2026

Reviewed by FirstInTest Editorial Team

Report an error
QuestionBack to list