sweb commented on a change in pull request #9047:
URL: https://github.com/apache/arrow/pull/9047#discussion_r550468948
##########
File path: rust/parquet/src/arrow/schema.rs
##########
@@ -657,6 +645,22 @@ impl ParquetTypeConverter<'_> {
}
}
+ fn to_decimal(&self) -> Result<DataType> {
+ let (precision, scale) = match self.schema {
+ Type::PrimitiveType {
+ ref precision,
+ ref scale,
+ ..
+ } => (*precision, *scale),
+ _ => {
+ return Err(ArrowError(
Review comment:
@sunchao thank you for your review comments! I changed this part as
suggested. Do you have an example of an assertion checking for a type? The only
thing I could come up with (still quite new to Rust) is something along the
lines of
```
if let Type::PrimitiveType {ref precision, ref scale, .. } = self.schema {
DataType::Decimal(*precision as usize, *scale as usize)
} else {
panic!("Expected a physical type, not a group type")
}
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]