apache / apache/datafusion

Make modulos with negative float zero compat with other engines

Open
#11,051 8 comments 2 reactions 1 assignee Claimed by @comphead View on GitHub
bug
Dominant language
Rust
Stars
9.3k
Forks
2.4k
Avg merge
3d 7h
Merged PRs (30d)
344

Description

### 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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.