apache / apache/datafusion

PostgreSQL compatibility: `log(0.0::float8)` should error, not return `-inf`

Open
#22,261 7 comments 1 reaction 1 assignee Claimed by @shinzoxD View on GitHub
bug
Dominant language
Rust
Stars
9.3k
Forks
2.4k
Avg merge
3d 7h
Merged PRs (30d)
344

Description

Split out from #22247.

### Mismatch

`log(0.0::float8)` should error, not return `-inf`.

```sql
SELECT log(0.0::float8);
```

PostgreSQL:

```text
ERROR: cannot take logarithm of zero
```

DataFusion:

```text
-inf
```

### Expected behavior

For PostgreSQL-compatible SQL semantics, DataFusion should either match PostgreSQL's result or raise the same class of domain/semantic error.

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.