QuestionQ281

VerifiedDeveloping Apache Spark™ DataFrame/DataSet API Applications

How do df.cache() and df.persist() differ for a Spark DataFrame?

Explanation

cache() persists a DataFrame using the default MEMORY_AND_DISK_DESER storage level. persist() also defaults to that level when called without an argument, but it accepts a StorageLevel argument, allowing the persistence level to be selected.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!