kumarUjjawal commented on code in PR #18999:
URL: https://github.com/apache/datafusion/pull/18999#discussion_r2573706522
##########
datafusion/sqllogictest/test_files/decimal.slt:
##########
@@ -805,6 +805,12 @@ select log(arrow_cast(100, 'Decimal32(9, 2)'));
----
2
+query R
+select log(2.0, arrow_cast(12345.67, 'Decimal32(9, 2)'));
+---
Review Comment:
```suggestion
----
```
##########
datafusion/functions/src/utils.rs:
##########
@@ -219,6 +221,15 @@ pub fn decimal128_to_i128(value: i128, scale: i8) ->
Result<i128, ArrowError> {
}
}
+pub fn decimal32_to_f64(value: i32, scale: i8) -> Result<f64, ArrowError> {
+ if scale == 0 {
+ Ok(value as f64)
Review Comment:
If negative scale should be an error, reject it explicitly and update the
test.
--
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]