-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Wrong results when grouping on a column with NULLs #782
Labels
bug
Something isn't working
Comments
Actually, it is more insidious -- note that
|
alamb
changed the title
Wrong results (missing rows) when grouping on a column with NULLs
Wrong results when grouping on a column with NULLs
Jul 27, 2021
Great find. I think group by doesn't support nulls at all ATM. The groupby scalars don't have a null and extracting a key doesn't look yet at whether the value is null or not. |
@Dandandan I think you are right. I will write up a proposal of how to fix this shortly. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Given a column with null values, if you group by that column the null values are lost
To Reproduce
Input:
And run
SELECT COUNT(*), c1 FROM test GROUP BY c1
Actual result
Expected behavior
Here is the correct answer according to postgres (note the row for
c1 is NULL
):Additional context
Discovered while playing around with #781
Here is the entire reproducer in postgres
The text was updated successfully, but these errors were encountered: