-
Notifications
You must be signed in to change notification settings - Fork 583
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
Support cache/uncache table syntax #670
Conversation
Pull Request Test Coverage Report for Build 3249154694
💛 - Coveralls |
src/ast/mod.rs
Outdated
@@ -1430,6 +1430,19 @@ pub enum Statement { | |||
// Specifies the actions to perform when values match or do not match. | |||
clauses: Vec<MergeClause>, | |||
}, | |||
/// CACHE TABLE <table_name> [[AS] [QUERY]] |
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.
What database is this meant to follow? It doesn't seem to follow Spark's syntax
How is it different than a CREATE VIEW
statement?
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.
Thanks for the doc, I will support the full Cache table syntax.
The difference between CACHE TABLE
and CREATE VIEW
is that users can cache small tables in memory before Join to speed up queries, such as dimension tables in data warehouse.The View should not be able to do this if it is not in memory.
}]), | ||
args: vec![FunctionArg::Unnamed(FunctionArgExpr::Expr(zero.clone()))], | ||
over: None, | ||
distinct: false, | ||
special: false, | ||
})), | ||
time_zone: "UTC-06:00".to_string() | ||
time_zone: "UTC-06:00".to_string(), |
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.
I don't mind the ,
everywhere but it sure makes the diff a lot bigger ;)
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.
I think this one is from the latest cargo fmt
@alamb Hi Andrew, could you review this PR again, if you have time. I have supported the full syntax. |
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.
Looks good to me -- thanks @francis-du !
}, | ||
SqlOption { | ||
name: Ident::with_quote('\'', "K2"), | ||
value: number("0.88"), |
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.
👍
@@ -5810,3 +5813,249 @@ fn parse_show_functions() { | |||
} | |||
); | |||
} | |||
|
|||
#[test] | |||
fn parse_cache_table() { |
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.
Close #669