You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make modulos with negative float zero compat with other engines #11051
Surprising that Postgres fails. According to the docs, Infinity, -Infinity, and NaN are legitimate floating point values. This is also the expected behavior per the ANSI SQL standard, afaik. NULL is not the right thing to return here.
andrewlamb@Andrews-MacBook-Pro-2:~/Software/arrow-rs$ psql -h localhost -U postgres
psql (14.12 (Homebrew), server 16.1 (Debian 16.1-1.pgdg120+1))
WARNING: psql major version 14, server major version 16.
Some psql features might not work.
Type "help"for help.
postgres=# select 1 % -0.0;
ERROR: division by zero
@comphead I'll take back my 'NULL is not the right thing to return here' comment. It's better than failing for most users.
Just one thing to keep in mind - Spark sql has a isnan function which should be consistent with this.
arrow-rs follows the rules of IEEE 754. If we intend to be compatible with other engines, many cases will also need to be modified, such as division by zero.
Activity
parthchandra commentedon Jun 21, 2024
Surprising that Postgres fails. According to the docs,
Infinity, -Infinity, and NaNare legitimate floating point values. This is also the expected behavior per the ANSI SQL standard, afaik.NULLis not the right thing to return here.alamb commentedon Jun 21, 2024
Postgres fails:
alamb commentedon Jun 21, 2024
I don't have a strong preference one way or the other, personally
comphead commentedon Jun 21, 2024
I would go with Spark/DuckDB way :) if there is no other strong opinions, I'll make a fix soon
parthchandra commentedon Jun 22, 2024
I wasn't doubting it. :) But I am surprised.
@comphead I'll take back my 'NULL is not the right thing to return here' comment. It's better than failing for most users.
Just one thing to keep in mind - Spark sql has a
isnanfunction which should be consistent with this.comphead commentedon Jun 22, 2024
Thanks @parthchandra for the suggestion, I just checked we should be fine.
jonahgao commentedon Jun 23, 2024
arrow-rs follows the rules of IEEE 754. If we intend to be compatible with other engines, many cases will also need to be modified, such as division by zero.
In PostgreSQL:
comphead commentedon Jun 23, 2024
This is a good point @jonahgao so this gives me even more confidence to introduce a new DF param which controls should DF go with IEEE 754