-
Notifications
You must be signed in to change notification settings - Fork 204
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
Four arithmetic operations between aggregation functions are not supported #320
Comments
Hey! This is indeed a limitation right now. You need to use a common table expression or subquery. |
Will you upgrade sqlparser?I understand this limitation is because of low version of sqlparser. |
This is unrelated to sqlparser and is just a limitation of the current SQL AST -> logical plan translation step. It would have to be written in a way that gets all leaf aggregations in each expression and then constructs a GroupBy (all aggregations) -> Map (operations on aggregations). |
You mean that the parse is actually successful, but there is a problem when the ast is converted into a logical plan
When I parsed this sql, he had a problem. The sum(1)/7 would not be divided into two args 【sum(1) and 7 】. |
demo 1 response1 {"error": "couldn't parse query: invalid argument syntax error at position 20"} demo 2 response 2 |
demo3 response3 |
There's a bug, which is in fact in the parser, where sometimes division isn't parsed correctly. This is because the parser supports just writing out file paths as tables names ( |
Yeah, you can see that in demo3. It tries to process the sum as a function, not as an aggregate. |
Thank you for your reply, can u give me some example about
|
Oh, it's indeed broken, but now I found the right way: leave a space between |
yes, the error show as below. {"error": "typecheck error: unknown function: sum(NULL | Int)"} |
hi, how can I fix this problem |
The sql parser cannot parse this kind of sql
The text was updated successfully, but these errors were encountered: