alamb commented on code in PR #6738:
URL: https://github.com/apache/arrow-rs/pull/6738#discussion_r1891676534


##########
parquet/src/schema/types.rs:
##########
@@ -556,7 +556,8 @@ impl<'a> PrimitiveTypeBuilder<'a> {
                 }
             }
             PhysicalType::FIXED_LEN_BYTE_ARRAY => {
-                let max_precision = (2f64.powi(8 * self.length - 1) - 
1f64).log10().floor() as i32;
+                let length = self.length.checked_mul(8).unwrap_or(i32::MAX);

Review Comment:
   I agree it would be better to return an error:
   
   I double checked that using i32::MAX results in 
   
   ```
   Max precision: 2147483647
   ```
   
   
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=8b510b23f773540e2b348e80f0691b41
   
   



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