diff --git a/arrow-array/src/array/primitive_array.rs b/arrow-array/src/array/primitive_array.rs index 457c2428145e..87de5f61605f 100644 --- a/arrow-array/src/array/primitive_array.rs +++ b/arrow-array/src/array/primitive_array.rs @@ -859,11 +859,7 @@ impl PrimitiveArray { where K: ArrowPrimitiveType, { - let d = self.to_data().into_builder().data_type(K::DATA_TYPE); - - // SAFETY: - // Native type is the same - PrimitiveArray::from(unsafe { d.build_unchecked() }) + PrimitiveArray::new(self.values.clone(), self.nulls.clone()) } /// Applies a unary infallible function to a primitive array, producing a