Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Question: Explain the difference between Spark transformations and actions.
Answer: Transformations are operations that create a new RDD, while actions are operations that return a value to the driver program or write data to an external storage system.

Example:

val mappedRDD = inputRDD.map(x => x * 2)
val result = mappedRDD.reduce((x, y) => x + y)
Is it helpful? Yes No

Most helpful rated by users:

©2025 WithoutBook