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

   ## Which issue does this PR close?
   
   Closes #22271.
   
   ## Rationale for this change
   
   `ln(-1.0::float8)` returns NaN in DataFusion but PostgreSQL raises an error: 
"cannot take logarithm of a negative number". This is one of the PostgreSQL 
compat issues tracked in #22247.
   
   ## What changes are included in this PR?
   
   - Add `validate_ln_input` that errors when input ≤ 0
   - Pass validator to `make_math_unary_udf!` for `LnFunc`, same pattern as 
`sqrt()`
   
   ## Are these changes tested?
   
   Existing math tests pass. The validator follows the same pattern as 
`validate_sqrt_input` which is well-tested.
   
   ## Are there any user-facing changes?
   
   Yes — `ln(x)` now returns an error for x ≤ 0 instead of NaN. This is a 
behavior change toward PostgreSQL compatibility.


-- 
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