Skip to content
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

SQL: COUNT(column) takes into account NULLs #34549

Closed
costin opened this issue Oct 17, 2018 · 3 comments
Closed

SQL: COUNT(column) takes into account NULLs #34549

costin opened this issue Oct 17, 2018 · 3 comments
Assignees

Comments

@costin
Copy link
Member

costin commented Oct 17, 2018

Currently COUNT(column) has the same behavior as COUNT(*) when it comes to handling NULLs which is incorrect. The former should exclude them while the latter should not. This is further exacerbated when dealing with filtering (HAVING) and when dealing with missing/NULL groups.

The root of the problem is mapping count to the bucket count which doesn't take into account null groups (in which case the count should be 0).

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search-aggs

@colings86 colings86 added v6.6.0 and removed v6.5.0 labels Oct 25, 2018
@jasontedor jasontedor added v6.7.0 and removed v6.6.0 labels Dec 19, 2018
@astefan
Copy link
Contributor

astefan commented Jan 7, 2019

Related to #30285.

@astefan
Copy link
Contributor

astefan commented Jan 10, 2019

Fixed as part of #30285

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants