Skip to content

Commit

Permalink
fix(common): fix conversion between Decimal to arrow Decimal128 (#19007)
Browse files Browse the repository at this point in the history
  • Loading branch information
wcy-fdu authored Oct 18, 2024
1 parent 60e124d commit aed4e6e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/common/src/array/arrow/arrow_iceberg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ impl IcebergArrowConvert {
impl ToArrow for IcebergArrowConvert {
#[inline]
fn decimal_type_to_arrow(&self, name: &str) -> arrow_schema::Field {
let data_type =
arrow_schema::DataType::Decimal128(arrow_schema::DECIMAL128_MAX_PRECISION, 0);
// Fixed-point decimal; precision P, scale S Scale is fixed, precision must be less than 38.
let data_type = arrow_schema::DataType::Decimal128(28, 10);
arrow_schema::Field::new(name, data_type, true)
}

Expand Down Expand Up @@ -178,7 +178,7 @@ impl ToArrow for IcebergCreateTableArrowConvert {
// We choose 28 here
// The decimal type finally will be converted to an iceberg decimal type.
// Iceberg decimal(P,S)
// Fixed-point decimal; precision P, scale S Scale is fixed, precision must be 38 or less.
// Fixed-point decimal; precision P, scale S Scale is fixed, precision must be less than 38.
let data_type = arrow_schema::DataType::Decimal128(28, 10);

let mut arrow_field = arrow_schema::Field::new(name, data_type, true);
Expand Down

0 comments on commit aed4e6e

Please sign in to comment.