You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/01/01 11:45:16 UTC

[GitHub] [arrow] sweb commented on a change in pull request #9047: ARROW-11072: [Rust] [Parquet] Support reading decimal from physical int types

sweb commented on a change in pull request #9047:
URL: https://github.com/apache/arrow/pull/9047#discussion_r550760559



##########
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:
       Thank you very much! I changed it to use an assertion. Let me know if you prefer this variant - there are other methods in `schema.rs` that follow a similar pattern and I could also change them accordingly while I am already here.




----------------------------------------------------------------
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:
users@infra.apache.org