-
Notifications
You must be signed in to change notification settings - Fork 33
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
[FEATURE] Support aggregate functions in Eval expressions #755
Comments
I found the current draft PR still has some problem. And more further, it is sorts of tricky to provide this enhancement.
This plan will be optimized to
Now, this feature is arm to support aggregate functions in
Will build a plan like this:
Unfortunately, Spark analyzer will resolve this
Then the resolution will fail because aggregate expression So the only successful case is putting one comma separated eval expression in the second to last position:
This design is tricky and anti-robust, and even it could be rewrite to
So I think we should not continue this feature since it should work by |
@LantaoJin thanks for this deep analysis - I agree that if we can support the same functionality in |
Sure, I will give a doc PR later. |
What is the bug?
Aggregate functions could work in select clause even there is no group by as long as all items in
select
are aggregate functions.Here are some examples:
But the following queries should throw exceptions
They could work with a
group by
Similar, aggregate functions in PPL could work in
eval
command, because an eval expression equals to add a projection to existing project list.Here are some examples:
But the following PPL queries should throw exceptions
How can one reproduce the bug?
The query failed with syntax error:
The text was updated successfully, but these errors were encountered: