You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "Dandandan (via GitHub)" <gi...@apache.org> on 2026/05/16 16:38:10 UTC

[I] PostgreSQL compatibility: `ln(-1.0::float8)` should error, not return NaN [datafusion]

Dandandan opened a new issue, #22271:
URL: https://github.com/apache/datafusion/issues/22271

   Split out from #22247.
   
   ### Mismatch
   
   `ln(-1.0::float8)` should error, not return NaN.
   
   ```sql
   SELECT ln((-1.0)::float8);
   ```
   
   PostgreSQL:
   
   ```text
   ERROR: cannot take logarithm of a negative number
   ```
   
   DataFusion:
   
   ```text
   NaN
   ```
   
   ### Expected behavior
   
   For PostgreSQL-compatible SQL semantics, DataFusion should either match PostgreSQL's result or raise the same class of domain/semantic error.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] PostgreSQL compatibility: `ln(-1.0::float8)` should error, not return NaN [datafusion]

Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey commented on issue #22271:
URL: https://github.com/apache/datafusion/issues/22271#issuecomment-5506328749

   thanks for your interest @TinyMurky 
   
   however i think there needs to be some discussion on if we actually want to proceed with this issue before someone can actually implement it, see my above comment


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] PostgreSQL compatibility: `ln(-1.0::float8)` should error, not return NaN [datafusion]

Posted by "kumarUjjawal (via GitHub)" <gi...@apache.org>.
kumarUjjawal commented on issue #22271:
URL: https://github.com/apache/datafusion/issues/22271#issuecomment-4476325501

   Duckdb
   
   ```
   memory D SELECT ln((-1.0)::float8);
   Out of Range Error:
   cannot take logarithm of a negative number
   memory D
   ```
   
   Both duckdb and PG are correct.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] PostgreSQL compatibility: `ln(-1.0::float8)` should error, not return NaN [datafusion]

Posted by "kumarUjjawal (via GitHub)" <gi...@apache.org>.
kumarUjjawal commented on issue #22271:
URL: https://github.com/apache/datafusion/issues/22271#issuecomment-4506400453

   ```
   DataFusion CLI v53.1.0
   > >   SELECT
       ln(2.0)    AS ln_pos,
       log10(100.0) AS log10_pos,
       log(-1.0)    AS log_neg,
       log2(-1.0)   AS log2_neg,
       log10(-1.0)  AS log10_neg;
   +--------------------+-----------+---------+----------+-----------+
   | ln_pos             | log10_pos | log_neg | log2_neg | log10_neg |
   +--------------------+-----------+---------+----------+-----------+
   | 0.6931471805599453 | 2.0       | NaN     | NaN      | NaN       |
   +--------------------+-----------+---------+----------+-----------+
   1 row(s) fetched.
   Elapsed 0.004 seconds.
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] PostgreSQL compatibility: `ln(-1.0::float8)` should error, not return NaN [datafusion]

Posted by "TinyMurky (via GitHub)" <gi...@apache.org>.
TinyMurky commented on issue #22271:
URL: https://github.com/apache/datafusion/issues/22271#issuecomment-5502985819

   Sorry! May I work on this issue? 
   
   I want to follow pull request https://github.com/apache/datafusion/pull/22276, and try to tackle the `Power` domain part


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] PostgreSQL compatibility: `ln(-1.0::float8)` should error, not return NaN [datafusion]

Posted by "puneetdixit200 (via GitHub)" <gi...@apache.org>.
puneetdixit200 commented on issue #22271:
URL: https://github.com/apache/datafusion/issues/22271#issuecomment-4505699259

   take


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] PostgreSQL compatibility: `ln(-1.0::float8)` should error, not return NaN [datafusion]

Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey commented on issue #22271:
URL: https://github.com/apache/datafusion/issues/22271#issuecomment-5462612285

   - it seems this may have been a conscious decision, see: https://github.com/apache/datafusion/issues/5259


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org