Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
c7d9267
add bitwise ops
rluvaton Oct 12, 2025
d14e5b7
add bitwise ops
rluvaton Oct 12, 2025
739fe0a
cleanup
rluvaton Oct 12, 2025
0e15b32
pub(crate) as I don't like that we have both mutable and only left mu…
rluvaton Oct 12, 2025
c442299
start adding tests
rluvaton Oct 12, 2025
2f28dc3
add tests
rluvaton Oct 12, 2025
c4676a6
add trait for left
rluvaton Oct 15, 2025
da03628
format
rluvaton Oct 15, 2025
652a256
revert changes
rluvaton Oct 15, 2025
0c29f0e
fix validation
rluvaton Oct 15, 2025
bcd4863
remove many unsafe and cleanup
rluvaton Oct 15, 2025
6b7bfe9
format
rluvaton Oct 15, 2025
aec92d6
add reproduction test
rluvaton Oct 26, 2025
db3e853
extract, cleanup and add comments
rluvaton Oct 26, 2025
0a64bcb
add comments
rluvaton Oct 26, 2025
ca621f8
Merge remote-tracking branch 'apache/main' into add-bitwise-ops-to-bo…
alamb Nov 3, 2025
d63d72c
Update arrow-buffer/src/buffer/mutable_ops.rs
alamb Nov 3, 2025
464e56c
Merge branch 'add-bitwise-ops-to-boolean-buffer-builder' of github.co…
alamb Nov 3, 2025
07679d7
Revert changes to boolean
alamb Nov 3, 2025
bfdf381
Restore enough for the tests
alamb Nov 3, 2025
246d4e2
Improve docs
alamb Nov 3, 2025
b9acb34
Move into mutable module
alamb Nov 3, 2025
d590ee1
Add example/doc tests
alamb Nov 3, 2025
ccf266f
Add tests for out of bounds
alamb Nov 3, 2025
005c444
Add tests for unary ops
alamb Nov 3, 2025
3a8e760
Add panic doc
alamb Nov 3, 2025
cf52bdf
fmt
alamb Nov 3, 2025
6dbed0b
Move buffer modification to bit_utils
alamb Nov 5, 2025
9ca7e45
Move tests and remove changes to MutableBufer
alamb Nov 5, 2025
5cb50d5
Merge remote-tracking branch 'apache/main' into add-bitwise-ops-to-bo…
alamb Nov 5, 2025
379d1ec
Update docs
alamb Nov 5, 2025
1fb4981
fix docs
alamb Nov 5, 2025
e03f2f0
Rename to `apply_bitwise_binary_op` and `apply_bitwise_unary_op`
alamb Nov 7, 2025
4c5db8d
Merge remote-tracking branch 'apache/main' into add-bitwise-ops-to-bo…
alamb Nov 7, 2025
8824af4
Add reference to new ops in MutableBuffer docs
alamb Nov 7, 2025
0f9597c
Fix link
alamb Nov 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions arrow-buffer/src/buffer/immutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,12 @@ impl std::ops::Deref for Buffer {
}
}

impl AsRef<[u8]> for &Buffer {
fn as_ref(&self) -> &[u8] {
self.as_slice()
}
}

impl From<MutableBuffer> for Buffer {
#[inline]
fn from(buffer: MutableBuffer) -> Self {
Expand Down
15 changes: 12 additions & 3 deletions arrow-buffer/src/buffer/mutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,18 @@ use super::Buffer;

/// A [`MutableBuffer`] is Arrow's interface to build a [`Buffer`] out of items or slices of items.
///
/// [`Buffer`]s created from [`MutableBuffer`] (via `into`) are guaranteed to have its pointer aligned
/// [`Buffer`]s created from [`MutableBuffer`] (via `into`) are guaranteed to be aligned
/// along cache lines and in multiple of 64 bytes.
///
/// Use [MutableBuffer::push] to insert an item, [MutableBuffer::extend_from_slice]
/// to insert many items, and `into` to convert it to [`Buffer`].
///
/// For a safe, strongly typed API consider using [`Vec`] and [`ScalarBuffer`](crate::ScalarBuffer)
/// # See Also
/// * For a safe, strongly typed API consider using [`Vec`] and [`ScalarBuffer`](crate::ScalarBuffer)
/// * To apply bitwise operations, see [`apply_bitwise_binary_op`] and [`apply_bitwise_unary_op`]
///
/// Note: this may be deprecated in a future release ([#1176](https://github.com/apache/arrow-rs/issues/1176))
/// [`apply_bitwise_binary_op`]: crate::bit_util::apply_bitwise_binary_op
/// [`apply_bitwise_unary_op`]: crate::bit_util::apply_bitwise_unary_op
///
/// # Example
///
Expand Down Expand Up @@ -812,6 +815,12 @@ impl std::ops::DerefMut for MutableBuffer {
}
}

impl AsRef<[u8]> for &MutableBuffer {
fn as_ref(&self) -> &[u8] {
self.as_slice()
}
}

impl Drop for MutableBuffer {
fn drop(&mut self) {
if self.layout.size() != 0 {
Expand Down
Loading
Loading