Skip to content

Commit

Permalink
fix(iceberg): fix decimal type for iceberg source (#17854)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenzl25 authored Jul 30, 2024
1 parent f555be5 commit 59331ab
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/common/src/array/arrow/arrow_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ pub trait FromArrow {
Int16 => self.from_int16_array(array.as_any().downcast_ref().unwrap()),
Int32 => self.from_int32_array(array.as_any().downcast_ref().unwrap()),
Int64 => self.from_int64_array(array.as_any().downcast_ref().unwrap()),
Decimal128(_, _) => self.from_decimal128_array(array.as_any().downcast_ref().unwrap()),
Decimal256(_, _) => self.from_int256_array(array.as_any().downcast_ref().unwrap()),
Float32 => self.from_float32_array(array.as_any().downcast_ref().unwrap()),
Float64 => self.from_float64_array(array.as_any().downcast_ref().unwrap()),
Expand Down Expand Up @@ -602,6 +603,13 @@ pub trait FromArrow {
Ok(ArrayImpl::Int256(array.into()))
}

fn from_decimal128_array(
&self,
array: &arrow_array::Decimal128Array,
) -> Result<ArrayImpl, ArrayError> {
Ok(ArrayImpl::Decimal(array.try_into()?))
}

fn from_float32_array(
&self,
array: &arrow_array::Float32Array,
Expand Down

0 comments on commit 59331ab

Please sign in to comment.