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

[GitHub] [arrow-rs] spebern commented on a diff in pull request #3950: Faster i256 parsing

spebern commented on code in PR #3950:
URL: https://github.com/apache/arrow-rs/pull/3950#discussion_r1148558645


##########
arrow-buffer/src/bigint.rs:
##########
@@ -40,6 +59,67 @@ impl std::fmt::Display for i256 {
     }
 }
 
+impl FromStr for i256 {
+    type Err = ParseI256Error;
+
+    fn from_str(s: &str) -> Result<Self, Self::Err> {
+        // i128 can store up to 38 decimal digits
+        if s.len() <= 38 {
+            return Ok(Self::from_i128(i128::from_str(s)?));

Review Comment:
   Does it makes sense to use `lexical` here and at the other places for parsing `i128`? 



-- 
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