xiedeyantu opened a new pull request, #22564: URL: https://github.com/apache/datafusion/pull/22564
## Which issue does this PR close? - Closes #22261 . ## Rationale for this change The current `log` implementation does not handle `log(0)` consistently across all execution paths. In some cases it can return infinity-like results instead of a clear error. This change makes zero input fail explicitly so the behavior is predictable and easier to reason about. ## What changes are included in this PR? This change adds zero-value validation in log.rs and applies it across the floating-point and decimal log code paths. Any input value equal to zero now returns `cannot take logarithm of zero` instead of continuing with a calculation that would produce an unexpected result. The regression test in scalar.slt was also updated to expect the new error behavior for `log(0)`. ## Are these changes tested? Yes. The sqllogictest coverage was updated to verify the new `log(0)` error behavior. ## Are there any user-facing changes? Yes. `log(0)` now returns an explicit error with the message `cannot take logarithm of zero` instead of producing an infinite result. -- 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]
