tmi commented on code in PR #10899:
URL: https://github.com/apache/datafusion/pull/10899#discussion_r1638332841


##########
datafusion/functions/src/math/round.rs:
##########
@@ -109,6 +109,9 @@ pub fn round(args: &[ArrayRef]) -> Result<ArrayRef> {
 
     if args.len() == 2 {
         decimal_places = ColumnarValue::Array(args[1].clone());
+        // if cast fails, we return error instead of panic. Better solution 
would to update
+        // function signature and instead error during planning -- to be 
improved later
+        _ = decimal_places.cast_to(&Int32, None)?;

Review Comment:
   @alamb sure thing, thx for the suggestion -- I've added it in the recent 
commit, both for the scalar and array cases. Does it look ok?



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to