alamb commented on a change in pull request #1223:
URL: https://github.com/apache/arrow-rs/pull/1223#discussion_r795177390
##########
File path: arrow/src/csv/reader.rs
##########
@@ -900,15 +899,8 @@ fn parse_decimal_with_parameter(s: &str, precision: usize,
scale: usize) -> Resu
if negative {
result = result.neg();
}
- if result > MAX_DECIMAL_FOR_EACH_PRECISION[precision - 1]
- || result < MIN_DECIMAL_FOR_EACH_PRECISION[precision - 1]
- {
- return Err(ArrowError::ParseError(format!(
- "parse decimal overflow, the precision {}, the scale {}, the
value {}",
- precision, scale, s
- )));
- }
- Ok(result)
+ validate_decimal_precision(result, precision)
Review comment:
I consolidated the bounds checking (so that I could also use it in
`with_precision_and_scale`)
--
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]