-
Notifications
You must be signed in to change notification settings - Fork 636
Add support for ClickHouse CSE. #2024
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
Common scalar expressions: `WITH <expr> AS <ident>`.
Due to incompatible changes in `With`.
src/ast/query.rs
Outdated
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 we can skip this impl, in order to reduce the API surface of the library
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.
But then we'd need way more changes in the existing code that relies on https://docs.rs/sqlparser/latest/sqlparser/ast/struct.With.html#structfield.cte_tables being Cte
. I am on the edge here.
src/parser/mod.rs
Outdated
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.
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.
Not pub
?
Here there is a suggestion to use a parser method directly (as a solution/workaround for some problem): #713
So, I assumed all/most of Parser
methods are/should be available to users.
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.
For example, currently it's 195 private methods and 322 public methods.
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.
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.
Same as above: #2024 (comment)
as dialect feature detection.
Otherwise, the compiler complains about lifetimes.
Only for ClickHouse for now.
Only for ClickHouse for now.
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.
Should we also add this to the generic dialect? I could not grasp the idea of what expressions should be supported in the generic dialect and what should be not.
For example, supports_select_expr_star
isn't listed as supported. Neither is supports_select_exclude
.
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.
Interesting: https://fiddle.clickhouse.com/1292850a-31e4-49c7-a309-79bc47a273a2
I am not sure whether it's a feature or a bug in the ClickHouse syntax parser. But since these examples don't make much sense, let's leave them as rejected.
Uh oh!
There was an error while loading. Please reload this page.
https://clickhouse.com/docs/sql-reference/statements/select/with#common-scalar-expressions:
fixes #1514.