Skip to content

Incorrect results for not (NaN between A and B) #13807

@bhhari

Description

@bhhari

Consider a table with a double column with some NaN values.The following queries return inconsistent results. not (val between 1 and 3) when used as a filter excludes NaN rows, but when used as a projection returns true.

presto:tpch> select * from nan;
 val
-----
 NaN
(1 row)

presto:tpch> select * from nan where not (val between 1 and 3);
 val
-----
(0 rows)

presto:tpch> select not (val between 1 and 3) from nan;
 _col0
-------
 true
(1 row)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions