puneetdixit200 opened a new pull request, #22738:
URL: https://github.com/apache/datafusion/pull/22738

   ## Which issue does this PR close?
   
   - Closes #22271.
   
   ## Rationale for this change
   
   PostgreSQL-compatible logarithm behavior should reject negative inputs 
instead of returning `NaN`. DataFusion already keeps the existing zero/base-one 
edge cases, so this change is scoped to negative logarithm arguments.
   
   ## What changes are included in this PR?
   
   - Adds a positive-domain check for `ln`, `log2`, and `log10`.
   - Adds the same negative-value check to `log(...)` for float and decimal 
inputs.
   - Updates scalar sqllogictests and log unit tests to cover the new error 
behavior while keeping existing zero/base behavior unchanged.
   
   ## Are these changes tested?
   
   - `cargo fmt --all`
   - `cargo test -p datafusion-functions log --lib`
   - `cargo test --profile=ci --test sqllogictests -- scalar.slt`
   - `cargo clippy --all-targets --all-features -- -D warnings`
   
   ## Are there any user-facing changes?
   
   Yes. Negative logarithm inputs now return a domain error instead of `NaN`.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to