Skip to content

COUNT(NULL) should always return 0 #8509

@joroKr21

Description

@joroKr21

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions