Do you need to cache a DataFrame in SQL?

PySpark and Scala API both have either cache or persist methods but what about SQL API?

The SQL API also supports caching. It does it with the following commands:

  • CACHE TABLE
  • UNCACHE TABLE
  • CLEAR CACHE