sweb commented on a change in pull request #9047:
URL: https://github.com/apache/arrow/pull/9047#discussion_r550882210
##########
File path: rust/parquet/src/schema/types.rs
##########
@@ -103,6 +103,24 @@ impl Type {
}
}
+ /// Gets precision of this primitive type.
+ /// Note that this will panic if called on a non-primitive type.
+ pub fn get_precision(&self) -> i32 {
+ match *self {
+ Type::PrimitiveType { precision, ..} => precision,
+ _ => panic!("Cannot call get_precision() on non-primitive type")
+ }
+ }
+
+ /// Gets scale of this primitive type.
+ /// Note that this will panic if called on a non-primitive type.
+ pub fn get_scale(&self) -> i32 {
+ match *self {
+ Type::PrimitiveType { scale, ..} => scale,
+ _ => panic!("Cannot call get_scale() on non-primitive type")
Review comment:
I added one more commit, using the new getters in `array_reader` to
simplify the decimal converter construction.
----------------------------------------------------------------
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]