Skip to content

Commit

Permalink
fix(iceberg): fix decimal type for iceberg source (#17854) (#17859)
Browse files Browse the repository at this point in the history
Co-authored-by: Dylan <[email protected]>
  • Loading branch information
github-actions[bot] and chenzl25 authored Jul 30, 2024
1 parent 0542faf commit cb50017
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 @@ -519,6 +519,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 @@ -596,6 +597,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 cb50017

Please sign in to comment.