Skip to content
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

[SQL] - Support cache/uncache table syntax #3842

Closed
francis-du opened this issue Oct 15, 2022 · 3 comments
Closed

[SQL] - Support cache/uncache table syntax #3842

francis-du opened this issue Oct 15, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@francis-du
Copy link
Contributor

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

Currently, DataFrame can cache tables in memory, but cannot cache DataFusion tables or views through SQL.

Describe the solution you'd like

I want to cache views and tables via CACHE TABLE <table_name> syntax like Spark SQL.At the same time, it is also necessary to support the UNCACHE TABLE <table_name> syntax to allow users to delete tables and views that do not require caching in memory.

Here are some docs aboutCACHE TABLE and UNCACHE TABLE in Spark SQL:

1.CACHE TABLE: https://docs.databricks.com/spark/latest/spark-sql/language-manual/sql-ref-syntax-aux-cache-cache-table.html

2.UNCACHE TABLE: https://docs.databricks.com/spark/latest/spark-sql/language-manual/sql-ref-syntax-aux-cache-uncache-table.html

Describe alternatives you've considered

I has been implemented the syntax in apache/datafusion-sqlparser-rs#670, I will support it in DataFusion next, if anyone is interested, welcome to discuss here.

@francis-du francis-du added the enhancement New feature or request label Oct 15, 2022
@francis-du francis-du changed the title Support cache/uncache table syntax [SQL] - Support cache/uncache table syntax Oct 15, 2022
@Dandandan
Copy link
Contributor

How much different is this from CREATE TABLE AS (which currently also creates an in memory table)?

I am not necessarily against this, but I think the syntax is very spark-specific. We can do about the same currently?

@francis-du
Copy link
Contributor Author

I looked at some code and I found CREATE TABLE is indeed possible to create an in-memory table. And also useDROP TABLE uncache in-memory table. 😢

@francis-du
Copy link
Contributor Author

It doesn't look like it's necessary to support those syntax 😥

@francis-du francis-du closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants