You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by tu...@apache.org on 2023/01/13 07:57:36 UTC

[arrow-rs] branch master updated: use the decimal_type to replace the decimal logical (#3522)

This is an automated email from the ASF dual-hosted git repository.

tustvold pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git


The following commit(s) were added to refs/heads/master by this push:
     new 2191e723d use the decimal_type to replace the decimal logical (#3522)
2191e723d is described below

commit 2191e723de3796638acbee6bdcbc246ea43d9a48
Author: Kun Liu <li...@apache.org>
AuthorDate: Fri Jan 13 15:57:30 2023 +0800

    use the decimal_type to replace the decimal logical (#3522)
---
 parquet/src/arrow/schema/primitive.rs | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/parquet/src/arrow/schema/primitive.rs b/parquet/src/arrow/schema/primitive.rs
index bd56583a8..e95db2b03 100644
--- a/parquet/src/arrow/schema/primitive.rs
+++ b/parquet/src/arrow/schema/primitive.rs
@@ -235,14 +235,8 @@ fn from_byte_array(info: &BasicTypeInfo, precision: i32, scale: i32) -> Result<D
         (None, ConvertedType::BSON) => Ok(DataType::Binary),
         (None, ConvertedType::ENUM) => Ok(DataType::Binary),
         (None, ConvertedType::UTF8) => Ok(DataType::Utf8),
-        (Some(LogicalType::Decimal { precision, scale }), _) => Ok(DataType::Decimal128(
-            precision.try_into().unwrap(),
-            scale.try_into().unwrap(),
-        )),
-        (None, ConvertedType::DECIMAL) => Ok(DataType::Decimal128(
-            precision.try_into().unwrap(),
-            scale.try_into().unwrap(),
-        )),
+        (Some(LogicalType::Decimal { scale: s, precision: p }), _) => decimal_type(s, p),
+        (None, ConvertedType::DECIMAL) => decimal_type(scale, precision),
         (logical, converted) => Err(arrow_err!(
             "Unable to convert parquet BYTE_ARRAY logical type {:?} or converted type {}",
             logical,