快取資料表Cache Table

CACHE [LAZY] TABLE [db_name.]table_name

使用 RDD 快取來快取記憶體中的資料表內容。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.

LAZY

延遲快取資料表,而不是立即掃描整個資料表。Cache the table lazily instead of eagerly scanning the entire table.

如需 RDD 快取和 Databricks IO 快取之間的差異,請參閱差異 和 Apache Spark 快取。See Delta and Apache Spark caching for the differences between the RDD cache and the Databricks IO cache.