You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2026/04/13 20:17:00 UTC
[PR] [arrow-array]: add PrimitiveArray mut-or-clone helpers [arrow-rs]
alamb opened a new pull request, #9707:
URL: https://github.com/apache/arrow-rs/pull/9707
# Which issue does this PR close?
- Closes https://github.com/apache/arrow-rs/issues/8808
# Rationale for this change
Inspired by matt in https://github.com/apache/arrow-rs/pull/9692/changes I wanted
to add some helper methods to the PrimitiveArray to make it easier to modify in place when possible, and clone when not possible.
# What changes are included in this PR?
Add the equivalent for primitive_array:
- bitwise_unary_mut_or_clone(self, op) -> Self
More specifically, this adds `PrimitiveArray::unary_mut_or_clone`, `PrimitiveArray::try_unary_mut_or_clone`, `PrimitiveArray::binary_mut_or_clone`, and `PrimitiveArray::try_binary_mut_or_clone`, along with doc examples and pointer-reuse tests. It also factors `arrow::compute::binary` through the shared `PrimitiveArray` binary implementation.
# Are these changes tested?
Yes.
I ran:
- `cargo test -p arrow-array`
- `cargo test -p arrow-array --doc`
- `cargo test -p arrow-arith`
- `cargo llvm-cov --html test -p arrow-array`
The new tests check both logical results and whether buffers are reused or reallocated using the same `PointerInfo` approach added for `BooleanArray`.
# Are there any user-facing changes?
Yes.
`PrimitiveArray` now has new public helper APIs for in-place mutation with an allocating fallback when the array is shared:
- `unary_mut_or_clone`
- `try_unary_mut_or_clone`
- `binary_mut_or_clone`
- `try_binary_mut_or_clone`
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add `PrimitiveArray` mut-or-clone helpers [arrow-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #9707:
URL: https://github.com/apache/arrow-rs/pull/9707#issuecomment-4239372227
I would like to to try and use these downstream in datafusion before marking this PR ready for review
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add `PrimitiveArray` mut-or-clone helpers [arrow-rs]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #9707: Add `PrimitiveArray` mut-or-clone helpers
URL: https://github.com/apache/arrow-rs/pull/9707
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add `PrimitiveArray` mut-or-clone helpers [arrow-rs]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9707:
URL: https://github.com/apache/arrow-rs/pull/9707#issuecomment-4785344602
Thank you for your contribution. Unfortunately, this pull request is stale because it has been open 60 days with no activity. Please remove the stale label or comment or this will be closed in 7 days.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add `PrimitiveArray` mut-or-clone helpers [arrow-rs]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9707:
URL: https://github.com/apache/arrow-rs/pull/9707#issuecomment-5389883440
Thank you for your contribution. Unfortunately, this pull request is stale because it has been open 60 days with no activity. Please remove the stale label or comment or this will be closed in 7 days.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org