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

COUNT(NULL) should always return 0 #8509

Closed
joroKr21 opened this issue Dec 12, 2023 · 0 comments · Fixed by #8511
Closed

COUNT(NULL) should always return 0 #8509

joroKr21 opened this issue Dec 12, 2023 · 0 comments · Fixed by #8511
Labels
bug Something isn't working

Comments

@joroKr21
Copy link
Contributor

joroKr21 commented Dec 12, 2023

Describe the bug

SELECT count(null) FROM test returns 5, i.e. it counts null as a not-null value.

To Reproduce

Add a test SELECT count(null) FROM test

Expected behavior

It should return 0, same as SELECT count(null::int) FROM test e.g. if we cast the null to another type.

Additional context

Confusing Arrow behaviour (but they will not change it): apache/arrow-rs#4838

@joroKr21 joroKr21 added the bug Something isn't working label Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant