Rich-T-kid commented on code in PR #10873:
URL: https://github.com/apache/arrow-rs/pull/10873#discussion_r3868180067


##########
arrow-integration-test/src/lib.rs:
##########
@@ -962,10 +962,15 @@ pub fn array_from_json(
                         let str = value.as_str().unwrap();
                         let integer = BigInt::parse_bytes(str.as_bytes(), 
10).unwrap();
                         let integer_bytes = integer.to_signed_bytes_le();
-                        let mut bytes = if integer.is_positive() {
-                            [0_u8; 32]
-                        } else {
+                        // `to_signed_bytes_le` returns the minimal-length
+                        // little-endian two's-complement encoding, so it must
+                        // be widened to the full 32 bytes by sign extension:
+                        // high bytes filled with 0x00 for non-negative values,
+                        // 0xFF for negative ones.

Review Comment:
   looks good!



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

Reply via email to