What is the primary difference between a 'transformation' and an 'action' in Spark?

Answer

Transformations return a new RDD/DataFrame, actions return a result or write data.

Explanation

Transformations create a new RDD/DataFrame/Dataset from an existing one and are lazily evaluated. Actions trigger the execution of the DAG of transformations and either return a result to the driver or write data to storage.

Last reviewed: October 2026

Reviewed by FirstInTest Editorial Team

Report an error
QuestionBack to list