I understood the point that in Scala there are 2 types of operations
Transformations like map(), filter() are
If you have some data that you might or might not use, making persist() eager would be inefficient. A normal Spark transformation corresponds to a def in Scala. A persist turns it into a lazy val.
persist()
def
lazy val