tustvold commented on code in PR #4830:
URL: https://github.com/apache/arrow-rs/pull/4830#discussion_r1332787634
##########
arrow-cast/src/cast.rs:
##########
@@ -2801,6 +2801,11 @@ where
if cast_options.safe {
let iter = from.iter().map(|v| {
v.and_then(|v| parse_string_to_decimal_native::<T>(v, scale as
usize).ok())
+ .and_then(|v| {
+ T::validate_decimal_precision(v, precision)
+ .is_ok()
+ .then_some(v)
+ })
Review Comment:
I don't feel strongly here, casting in general does tend to check for
overflow, and given it is parsing a string is unlikely to massively regress
performance. I defer to you @viirya
--
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]