jayzhan211 commented on code in PR #23676: URL: https://github.com/apache/datafusion/pull/23676#discussion_r4430705862
########## docs/source/library-user-guide/upgrading/56.0.0.md: ########## @@ -684,6 +684,25 @@ value of the stride instead. See [issue #25856] for details. [postgresql]: https://www.postgresql.org/docs/current/functions-datetime.html#FUNCTIONS-DATETIME-BIN [issue #25856]: https://github.com/apache/datafusion/issues/25856 +### `log(base, value)` widens float arguments to the wider type + +`log(base, value)` previously computed in the float type of `value`, so a +wider `base` was narrowed and lost precision. Both arguments are now widened to +the wider float type, and the result has that type. An integer or decimal +`base` counts as `Float64`. + +```sql +-- Before: 0.041666668 (Float32) +-- After: 0.041666666517376175 (Float64) +SELECT log(arrow_cast(16777217, 'Float64'), arrow_cast(2.0, 'Float32')); +``` Review Comment: Optional cleanup: the case most users will hit is probably an integer literal base with a `Float32` column (the `scalar.slt` change), so it may be worth naming it directly: ```diff SELECT log(arrow_cast(16777217, 'Float64'), arrow_cast(2.0, 'Float32')); ``` + +For example, `log(2, float32_col)` now returns `Float64` instead of `Float32`. ``` -- 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]
