Skip to content

Make log function to be in sync with PostgresSql #5259

Description

@comphead

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
The log function has some discrepancy with Postgres for edgecases e.g.

❯ select log(1, 64), log(0);
+-------------------------+---------------+
| log(Int64(1),Int64(64)) | log(Int64(0)) |
+-------------------------+---------------+
| inf | -inf |
+-------------------------+---------------+

The query executes ok, but in PostgresSql the query fail fast

postgres=# select log(0);
ERROR: cannot take logarithm of zero
postgres=# select log(1, 64);
ERROR: division by zero

Describe the solution you'd like
Investigate and implement log function to be the same behavior as for PostgresSql for edgecases above and perhaps for other like negative numbers, etc

Describe alternatives you've considered
Not doing this

Additional context
Found when working on #5245

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions