alamb commented on code in PR #9129:
URL: https://github.com/apache/arrow-rs/pull/9129#discussion_r2677663601
##########
arrow-array/src/array/primitive_array.rs:
##########
@@ -859,11 +859,9 @@ impl<T: ArrowPrimitiveType> PrimitiveArray<T> {
where
K: ArrowPrimitiveType<Native = T::Native>,
{
- 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())
Review Comment:
Bonus points that it removes some `unsafe`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]