-
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
Review the behavior of count
with multiple arguments
#11303
Comments
Related to this, we could maybe support zero-arg For 2+ args for count, I as a user would prefer to used filtered aggregation. It's then obvious whether I am counting rows when all args are not null, or when at least one is not null:
(definitely more verbose than |
I don't think so, therefore I prefer not to support it and returns error instead. |
This feature was introduced by #5908. Spark also supports it, and its behavior seems to be consistent with MySQL. So I think we can follow Spark.
We need to correct |
Is your feature request related to a problem or challenge?
DataFusion supports this type of syntax, such as
count(a, b)
andcount(distinct a, b)
.However, its behavior may not be well-defined. A counterintuitive behavior is that
count(distinct a, b)
returns more rows thancount(a, b)
.Additionally, PostgreSQL does not support this type of syntax. MySQL only supports
count(distinct a, b)
, but its result is different from DataFusion.Describe the solution you'd like
No response
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: