Cache Table

CACHE [LAZY] TABLE [db_name.]table_name

Cache the contents of the table in memory using the RDD cache. This enables subsequent queries to avoid scanning the original files as much as possible.

Cache the table lazily instead of eagerly scanning the entire table.

See Databricks IO and RDD cache comparison for the differences between the RDD cache and the Databricks IO cache.