puneetdixit200 opened a new pull request, #22410: URL: https://github.com/apache/datafusion/pull/22410
## Which issue does this PR close? - Closes #22271. ## Rationale for this change `ln` currently delegates directly to Rust floating-point `ln`, so negative inputs produce `NaN`. PostgreSQL-style semantics for this case should return a domain error instead. ## What changes are included in this PR? - Moves `ln` from the shared unary math macro to a focused implementation. - Returns a compute error for negative `Float32`/`Float64` inputs while preserving the existing `ln(0) -> -Infinity` behavior. - Adds SQL and unit coverage for the negative-input behavior. ## Are these changes tested? Yes: - `cargo test --profile=ci --test sqllogictests -- scalar.slt` - `cargo test --profile=ci -p datafusion-functions math::ln` - `cargo fmt --all` - `git diff --check` - `cargo clippy --profile=ci --all-targets --all-features -- -D warnings` ## Are there any user-facing changes? Yes. `ln` now returns an error for negative floating-point inputs instead of `NaN`. AI assistance: Used OpenAI GPT-5 to help draft and check this focused change; I reviewed the code and tests. -- 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]
