Jefffrey commented on code in PR #7098:
URL: https://github.com/apache/arrow-rs/pull/7098#discussion_r1947558154


##########
arrow-schema/src/datatype.rs:
##########
@@ -811,6 +857,12 @@ pub const DECIMAL256_MAX_PRECISION: u8 = 76;
 /// The maximum scale for [DataType::Decimal256] values
 pub const DECIMAL256_MAX_SCALE: i8 = 76;
 
+/// The default scale for [DataType::Decimal32] values
+pub const DECIMAL32_DEFAULT_SCALE: i8 = 2;
+
+/// The default scale for [DataType::Decimal64] values
+pub const DECIMAL64_DEFAULT_SCALE: i8 = 6;
+

Review Comment:
   Do we have a reference for these constants (both max precision/scale & 
defaults)?



##########
parquet/src/arrow/arrow_reader/statistics.rs:
##########
@@ -730,7 +783,7 @@ macro_rules! get_decimal_page_stats_iterator {
                             native_index
                                 .indexes
                                 .iter()
-                                .map(|x| x.$func.and_then(|x| 
Some($stat_value_type::from(x))))
+                                .map(|x| x.$func.and_then(|x| 
$stat_value_type::try_from(x).ok()))

Review Comment:
   Ditto here



##########
parquet/src/arrow/arrow_reader/statistics.rs:
##########
@@ -263,9 +275,10 @@ macro_rules! make_decimal_stats_iterator {
                         ParquetStatistics::Int32(s) => {
                             s.$func().map(|x| $stat_value_type::from(*x))
                         }
-                        ParquetStatistics::Int64(s) => {
-                            s.$func().map(|x| $stat_value_type::from(*x))
-                        }
+                        ParquetStatistics::Int64(s) => s
+                            .$func()
+                            .map(|x| $stat_value_type::try_from(*x).ok())
+                            .flatten(),

Review Comment:
   Are these changes significant?



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