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

Function BitmapAllButOne

cpp/src/arrow/util/bitmap_builders.cc:58–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58Result<std::shared_ptr<Buffer>> BitmapAllButOne(MemoryPool* pool, int64_t length,
59 int64_t straggler_pos, bool value) {
60 if (straggler_pos < 0 || straggler_pos >= length) {
61 return Status::Invalid("invalid straggler_pos ", straggler_pos);
62 }
63
64 ARROW_ASSIGN_OR_RAISE(auto buffer,
65 AllocateBuffer(bit_util::BytesForBits(length), pool));
66
67 auto bitmap_data = buffer->mutable_data();
68 bit_util::SetBitsTo(bitmap_data, 0, length, value);
69 bit_util::SetBitTo(bitmap_data, straggler_pos, !value);
70 return buffer;
71}
72
73} // namespace internal
74} // namespace arrow

Callers 1

ComputeNullBitmapFunction · 0.85

Calls 4

SetBitsToFunction · 0.70
SetBitToFunction · 0.70
InvalidFunction · 0.50
mutable_dataMethod · 0.45

Tested by

no test coverage detected