klion26 commented on code in PR #8357:
URL: https://github.com/apache/arrow-rs/pull/8357#discussion_r2354130737


##########
parquet-variant/src/utils.rs:
##########
@@ -144,3 +144,20 @@ pub(crate) const fn expect_size_of<T>(expected: usize) {
         let _ = [""; 0][size];
     }
 }
+
+pub(crate) fn fits_precision<const N: u32>(n: impl Into<i64>) -> bool {

Review Comment:
   Put `N` into the generic, not the parameter, because this can yield better 
performance, do I understand correctly?



##########
parquet-variant/src/variant.rs:
##########
@@ -1096,13 +1096,21 @@ impl<'m, 'v> Variant<'m, 'v> {
     /// let v2 = Variant::from(std::f64::consts::PI);
     /// assert_eq!(v2.as_f16(), Some(f16::from_f64(std::f64::consts::PI)));
     ///
+    /// // and from integers with no more than 11 bits of precision

Review Comment:
   Not sure if we need to add an overflow example here(e.g, Variant::from(2048) 
for f16)



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