You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "tustvold (via GitHub)" <gi...@apache.org> on 2023/03/25 11:37:43 UTC

[GitHub] [arrow-rs] tustvold commented on a diff in pull request #3939: Faster decimal parsing (30-60%)

tustvold commented on code in PR #3939:
URL: https://github.com/apache/arrow-rs/pull/3939#discussion_r1148355429


##########
arrow-cast/src/parse.rs:
##########
@@ -691,12 +681,12 @@ pub fn parse_decimal<T: DecimalType>(
         if exp as u8 + digits > precision {
             return Err(ArrowError::ParseError("parse decimal overflow".to_string()));
         }
-        let mul = base.pow_checked(exp as _)?;
-        result = result.mul_checked(mul)?;
+        let mul = base.pow_wrapping(exp as _);

Review Comment:
   I'm fairly certain this is correct, but could we possibly get some tests of numbers on the edge of overflowing?



-- 
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-unsubscribe@arrow.apache.org

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