Skip to content

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

Open

Description

@Dandandan

Split out from #22247.

Mismatch

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

SELECT log(0.0::float8);

PostgreSQL:

ERROR: cannot take logarithm of zero

DataFusion:

-inf

Expected behavior

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

Activity

  1. xiedeyantu commented on May 16, 2026

    @xiedeyantu
    Member

    take

  2. xiedeyantu commented on May 17, 2026

    @xiedeyantu
    Member

    If the changes in #22308 are approved, I can begin this task.

  3. kuppalaadvaith-alt commented on May 31, 2026

    @kuppalaadvaith-alt
  4. kuppalaadvaith-alt commented on May 31, 2026

    @kuppalaadvaith-alt
  5. shinzoxD commented on Aug 15, 2026

    @shinzoxD

    I'm working on this.

    Context: I first looked at #22263 (SIMILAR TO % wildcard), but that already has approved PR #23188, and the preferred fallbacks #22269 / #23258 are assigned. This sibling from the #22247 split is still open with no open PR.

    I'll keep the change tightly scoped to the issue: log(0.0::float8) (and other zero values) become the PostgreSQL domain error cannot take logarithm of zero. I will not change log(1, 64) / zero-base behavior, or the existing log simplifications, so this stays out of the scope-creep that closed #22564.

    @xiedeyantu I saw you previously took this and opened #22564. Please let me know if you are still working on a follow-up and I'll step back.

  6. shinzoxD commented on Aug 19, 2026

    @shinzoxD

    Leaving a note per the contributor guide: #22564 was closed, and there has been no follow-up PR since May. I opened #24399 for the scoped zero-value domain error (plus planner-simplification guards so log(0, 0) cannot fold to 1). Happy to step aside if you still want to take this one, @xiedeyantu.

  7. Jefffrey commented on Aug 29, 2026

    @Jefffrey
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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