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

Function GetTruncatedBitmap

cpp/src/arrow/ipc/writer.cc:88–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88Status GetTruncatedBitmap(int64_t offset, int64_t length,
89 const std::shared_ptr<Buffer>& input, MemoryPool* pool,
90 std::shared_ptr<Buffer>* buffer) {
91 if (!input) {
92 *buffer = input;
93 return Status::OK();
94 }
95 int64_t min_length = PaddedLength(bit_util::BytesForBits(length));
96 if (offset != 0 || min_length < input->size()) {
97 // With a sliced array / non-zero offset, we must copy the bitmap
98 ARROW_ASSIGN_OR_RAISE(*buffer, CopyBitmap(pool, input->data(), offset, length));
99 } else {
100 *buffer = input;
101 }
102 return Status::OK();
103}
104
105Status GetTruncatedBuffer(int64_t offset, int64_t length, int32_t byte_width,
106 const std::shared_ptr<Buffer>& input, MemoryPool* pool,

Callers 2

VisitArrayMethod · 0.85
VisitMethod · 0.85

Calls 7

BytesForBitsFunction · 0.85
PaddedLengthFunction · 0.70
ARROW_ASSIGN_OR_RAISEFunction · 0.70
OKFunction · 0.50
CopyBitmapFunction · 0.50
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected