Skip to content

[SPARK-4930][SQL][DOCS]Update SQL programming guide, CACHE TABLE is eager #3773

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions docs/sql-programming-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -1010,12 +1010,11 @@ let user control table caching explicitly:
CACHE TABLE logs_last_month;
UNCACHE TABLE logs_last_month;

**NOTE:** `CACHE TABLE tbl` is lazy, similar to `.cache` on an RDD. This command only marks `tbl` to ensure that
partitions are cached when calculated but doesn't actually cache it until a query that touches `tbl` is executed.
To force the table to be cached, you may simply count the table immediately after executing `CACHE TABLE`:
**NOTE:** `CACHE TABLE tbl` is now __eager__ by default not __lazy__. Don’t need to trigger cache materialization manually anymore.

CACHE TABLE logs_last_month;
SELECT COUNT(1) FROM logs_last_month;
Spark SQL newly introduced a statement to let user control table caching whether or not lazy since Spark 1.2.0:

CACHE [LAZY] TABLE [AS SELECT] ...

Several caching related features are not supported yet:

Expand Down