-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
GroupingSet
Expr --> String Support
#10521
Comments
Hi @alamb, I am wondering whether is there a way to implement the |
I think from the pub enum GroupingSet {
/// Rollup grouping sets
Rollup(Vec<Expr>, Vec<Vec<Expr>>),
/// Cube grouping sets
Cube(Vec<Expr>, Vec<Vec<Expr>>),
/// User-defined grouping sets
GroupingSets(Vec<Vec<Expr>>),
} |
Hi @xinlifoobar - another thing that we could potentially do is to work at this from the SQL statement level (rather than the Expr level) As in implement a round trip test like this for a query with a grouping set: |
I made a mistake about the previous statements. The vector of cube and rollout is not expanded so the implement could be easy. |
Thanks again @xinlifoobar |
Is your feature request related to a problem or challenge?
Part of #9726 to complete the Expr
Converting
Expr
back toSQL
is valuable for several usecases such as using DataFusion in federated databases (e.g. generate SQL to push down) or using DataFusion's expr APIs to programatically create SQL.Describe the solution you'd like
Support converting SQL syntax like this:
TODO I AM NOT SURE HOW TO MAKE THIS IN SQL
Describe alternatives you've considered
The basic pattern is:
Unparser::expr_to_sql
(source link)expr_to_sql_ok
Note you can run the tests like
cargo test -p datafusion-sql -- expr_to_sql_ok
Additional context
This is likely NOT a good first issue
The text was updated successfully, but these errors were encountered: