-
Notifications
You must be signed in to change notification settings - Fork 29.1k
[SPARK-27545][SQL][DOC] Update the Documentation for CACHE TABLE and UNCACHE TABLE #27090
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
Conversation
|
think about this example it's weird if we drop the temp view after uncache table. |
Yeah. Here its not wise to drop the temp view after uncache table. I did not take into account the possibility when user creates a view of their own. |
|
maybe we should clearly document that |
As shown above, Although Documenting it is a good idea. |
|
|
||
| ### Description | ||
| `CACHE TABLE` statement caches contents of a table or output of a query with the given storage level. This reduces scanning of the original files in future queries. | ||
| `CACHE TABLE` statement caches contents of a table or output of a query with the given storage level. It creates a temporary view with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a query is cached, then a temp view will be created for this query.
| ### Description | ||
| `UNCACHE TABLE` removes the entries and associated data from the in-memory and/or on-disk cache for a given table or view. The | ||
| underlying entries should already have been brought to cache by previous `CACHE TABLE` operation. `UNCACHE TABLE` on a non-existent table throws Exception if `IF EXISTS` is not specified. | ||
| underlying entries should already have been brought to cache by previous `CACHE TABLE` operation. `UNCACHE TABLE` do not remove |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does not remove
| `UNCACHE TABLE` removes the entries and associated data from the in-memory and/or on-disk cache for a given table or view. The | ||
| underlying entries should already have been brought to cache by previous `CACHE TABLE` operation. `UNCACHE TABLE` on a non-existent table throws Exception if `IF EXISTS` is not specified. | ||
| underlying entries should already have been brought to cache by previous `CACHE TABLE` operation. `UNCACHE TABLE` do not remove | ||
| the temporary view if it is created by `CACHE TABLE AS query`. `UNCACHE TABLE` on a non-existent table throws Exception if `IF EXISTS` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CACHE TABLE name AS query
|
can we update PR title and description as well? |
Done. |
|
ok to test |
|
Test build #116161 has finished for PR 27090 at commit
|
| `UNCACHE TABLE` removes the entries and associated data from the in-memory and/or on-disk cache for a given table or view. The | ||
| underlying entries should already have been brought to cache by previous `CACHE TABLE` operation. `UNCACHE TABLE` on a non-existent table throws Exception if `IF EXISTS` is not specified. | ||
| underlying entries should already have been brought to cache by previous `CACHE TABLE` operation. `UNCACHE TABLE` does not remove | ||
| the temporary view if it is created by `CACHE TABLE name AS query`. `UNCACHE TABLE` on a non-existent table throws Exception if `IF EXISTS` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UNCACHE TABLE does not remove the temporary view if it is created by CACHE TABLE name AS query -> it sounds like it will remove a temporary view that is not created by CACHE TABLE name AS query.
Or just say UNCACHE TABLE does not remove a temporary view?
| `UNCACHE TABLE` removes the entries and associated data from the in-memory and/or on-disk cache for a given table or view. The | ||
| underlying entries should already have been brought to cache by previous `CACHE TABLE` operation. `UNCACHE TABLE` on a non-existent table throws Exception if `IF EXISTS` is not specified. | ||
| underlying entries should already have been brought to cache by previous `CACHE TABLE` operation. `UNCACHE TABLE` does not remove | ||
| the temporary view if it is created by `CACHE TABLE name AS query`. `UNCACHE TABLE` on a non-existent table throws Exception if `IF EXISTS` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exception -> an exception
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
Test build #116214 has finished for PR 27090 at commit
|
|
@HyukjinKwon Any more changes required for this one? |
|
gentle ping @cloud-fan @HyukjinKwon |
| `UNCACHE TABLE` removes the entries and associated data from the in-memory and/or on-disk cache for a given table or view. The | ||
| underlying entries should already have been brought to cache by previous `CACHE TABLE` operation. `UNCACHE TABLE` on a non-existent table throws Exception if `IF EXISTS` is not specified. | ||
| underlying entries should already have been brought to cache by previous `CACHE TABLE` operation. `UNCACHE TABLE` does not remove | ||
| a temporary view. `UNCACHE TABLE` on a non-existent table throws an exception if `IF EXISTS` is not specified. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to highlight UNCACHE TABLE does not remove a temporary view.? It's intuitive that UNCACHE won't drop temp view.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. Make sense. I will update the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Please review @cloud-fan
|
Test build #118235 has finished for PR 27090 at commit
|
|
thanks, merging to master/3.0! |
…UNCACHE TABLE ### What changes were proposed in this pull request? Document updated for `CACHE TABLE` & `UNCACHE TABLE` ### Why are the changes needed? Cache table creates a temp view while caching data using `CACHE TABLE name AS query`. `UNCACHE TABLE` does not remove this temp view. These things were not mentioned in the existing doc for `CACHE TABLE` & `UNCACHE TABLE`. ### Does this PR introduce any user-facing change? Document updated for `CACHE TABLE` & `UNCACHE TABLE` command. ### How was this patch tested? Manually Closes #27090 from iRakson/SPARK-27545. Lead-authored-by: root1 <raksonrakesh@gmail.com> Co-authored-by: iRakson <raksonrakesh@gmail.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com> (cherry picked from commit b20754d) Signed-off-by: Wenchen Fan <wenchen@databricks.com>
|
@iRakson can you leave a message in the JIRA ticket so that I can assign it to you? |
…UNCACHE TABLE ### What changes were proposed in this pull request? Document updated for `CACHE TABLE` & `UNCACHE TABLE` ### Why are the changes needed? Cache table creates a temp view while caching data using `CACHE TABLE name AS query`. `UNCACHE TABLE` does not remove this temp view. These things were not mentioned in the existing doc for `CACHE TABLE` & `UNCACHE TABLE`. ### Does this PR introduce any user-facing change? Document updated for `CACHE TABLE` & `UNCACHE TABLE` command. ### How was this patch tested? Manually Closes apache#27090 from iRakson/SPARK-27545. Lead-authored-by: root1 <raksonrakesh@gmail.com> Co-authored-by: iRakson <raksonrakesh@gmail.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
What changes were proposed in this pull request?
Document updated for
CACHE TABLE&UNCACHE TABLEWhy are the changes needed?
Cache table creates a temp view while caching data using
CACHE TABLE name AS query.UNCACHE TABLEdoes not remove this temp view.These things were not mentioned in the existing doc for
CACHE TABLE&UNCACHE TABLE.Does this PR introduce any user-facing change?
Document updated for
CACHE TABLE&UNCACHE TABLEcommand.How was this patch tested?
Manually