MCPcopy Create free account
hub / github.com/apache/arrow / OptionalBitmapAnd

Function OptionalBitmapAnd

cpp/src/arrow/util/bitmap_ops.cc:410–438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

408}
409
410Result<std::shared_ptr<Buffer>> OptionalBitmapAnd(MemoryPool* pool,
411 const std::shared_ptr<Buffer>& left,
412 int64_t left_offset,
413 const std::shared_ptr<Buffer>& right,
414 int64_t right_offset, int64_t length,
415 int64_t out_offset) {
416 if (left == nullptr && right == nullptr) {
417 return nullptr;
418 }
419 if (left == nullptr) {
420 if (right_offset >= out_offset && (right_offset - out_offset) % 8 == 0) {
421 int64_t byte_shift = (right_offset - out_offset) / 8;
422 int64_t byte_length = bit_util::BytesForBits(out_offset + length);
423 return SliceBuffer(right, byte_shift, byte_length);
424 }
425 return CopyBitmap(pool, right->data(), right_offset, length, out_offset);
426 }
427 if (right == nullptr) {
428 if (left_offset >= out_offset && (left_offset - out_offset) % 8 == 0) {
429 int64_t byte_shift = (left_offset - out_offset) / 8;
430 int64_t byte_length = bit_util::BytesForBits(out_offset + length);
431 return SliceBuffer(left, byte_shift, byte_length);
432 }
433 return CopyBitmap(pool, left->data(), left_offset, length, out_offset);
434 }
435
436 return BitmapAnd(pool, left->data(), left_offset, right->data(), right_offset, length,
437 out_offset);
438}
439
440namespace {
441

Callers 1

FinalizeMethod · 0.85

Calls 5

BytesForBitsFunction · 0.85
SliceBufferFunction · 0.85
BitmapAndFunction · 0.85
CopyBitmapFunction · 0.70
dataMethod · 0.45

Tested by

no test coverage detected