pitrou commented on code in PR #45869:
URL: https://github.com/apache/arrow/pull/45869#discussion_r2006056322
##########
cpp/src/arrow/util/bitmap_ops.h:
##########
@@ -147,6 +147,31 @@ bool OptionalBitmapEquals(const std::shared_ptr<Buffer>&
left, int64_t left_offs
const std::shared_ptr<Buffer>& right, int64_t
right_offset,
int64_t length);
+/// \brief Do a "bitmap and" on right and left buffers starting at
+/// their respective bit-offsets for the given bit-length and put
+/// the results in out_buffer starting at the given bit-offset.
+/// Both right and left buffers are optional. If any of the buffers is
+/// null a bitmap of zeros is returned.
Review Comment:
And this would be even more useful as:
```c++
Result<std::shared_ptr<Buffer>> OptionalBitmapAnd(
MemoryPool* pool, const std::shared_ptr<Buffer>& left, int64_t
left_offset,
const std::shared_ptr<Buffer>& right, int64_t right_offset);
```
... because then, if one of the inputs is null, and the offsets are
compatible, we can return the other input (perhaps sliced) instead of
allocating a new buffer.
--
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]