alamb commented on issue #8156:
URL: https://github.com/apache/arrow-rs/issues/8156#issuecomment-3197185524
> For example, if you had a predicate of the form col > 34 it would only be
valid to push this down if the nan_counts are zero.
I think this is true if the system treats '-Nan` and `Nan` differently for
comparisons
It does appear to be the case that DataFusion treats `Nan`and `-Nan`
differently:
```sql
> create or replace table foo(x double) as values ('nan'), (34.0), (34.1),
('-nan');
0 row(s) fetched.
Elapsed 0.001 seconds.
> select x, x>34 from foo;
+------+-------------------+
| x | foo.x > Int64(34) |
+------+-------------------+
| NaN | true |
| 34.0 | false |
| 34.1 | true |
| NaN | false |
+------+-------------------+
4 row(s) fetched.
Elapsed 0.004 seconds.
```
However, Postgres does not 🤔
```sql
postgres=# create table foo (x real);
CREATE TABLE
postgres=# insert into foo values ('Nan'), (34.0), (34.1), ('-Nan');
INSERT 0 4
postgres=# select x, x>34 from foo;
x | ?column?
------+----------
NaN | t
34 | f
34.1 | t
NaN | t
(4 rows)
postgres=#
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]