Skip to content

Commit

Permalink
use the decimal_type to replace the decimal logical (#3522)
Browse files Browse the repository at this point in the history
  • Loading branch information
liukun4515 authored Jan 13, 2023
1 parent d49cd21 commit 2191e72
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions parquet/src/arrow/schema/primitive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2191e72

Please sign in to comment.