Jefffrey commented on code in PR #7098:
URL: https://github.com/apache/arrow-rs/pull/7098#discussion_r1947984186
##########
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:
Makes sense for precision. For default scale, do we have a reference from
the C++ implementation possibly, to align with that?
##########
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:
I think it's fine, was just curious as these changes specifically didn't
seem related to the rest here, so wondering what else was changed that made the
compiler require this change.
--
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]