Re: [PR] perf: Avoid ArrayData allocation in PrimitiveArray::reinterpret_cast [arrow-rs]
alamb merged PR #9129: URL: https://github.com/apache/arrow-rs/pull/9129 -- 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]
Re: [PR] perf: Avoid ArrayData allocation in PrimitiveArray::reinterpret_cast [arrow-rs]
alamb commented on PR #9129: URL: https://github.com/apache/arrow-rs/pull/9129#issuecomment-3734487908 Thanks @Jefffrey and @scovich -- 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]
Re: [PR] perf: Avoid ArrayData allocation in PrimitiveArray::reinterpret_cast [arrow-rs]
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 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())
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]
