Skip to content

Make modulos with negative float zero compat with other engines #11051

@comphead

Description

@comphead

Describe the bug

DF returns NaN in modulo query below and is not compliant with major engines:

> select 1 % -0.0;
+------------------------+
| Int64(1) % Float64(-0) |
+------------------------+
| NaN                    |
+------------------------+

PG, Trino fails on such query,
DuckDB, Spark returns NULL

@alamb @viirya @andygrove what would be expected behavior from DataFusion?
We can also introduce a config to be PG compliant or PG/Trino compliant?

To Reproduce

No response

Expected behavior

No response

Additional context

No response

Metadata

Metadata

Assignees

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