Is caching in spark a transformation or an action?


#1

Is caching in spark a transformation or an action?


#2

Though cache() or persist() is just another function on RDD which marks RDD to be cached or persisted. The first time an RDD is evaluated as a consequence of an action, it will be persisted/cached.

So, cache() or persist() is neither an action nor a transformation.