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

Function GetOrCopyNullBitmapBuffer

cpp/src/arrow/compute/kernels/util_internal.h:158–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156void AddNullExec(ScalarFunction* func);
157
158inline Result<std::shared_ptr<Buffer>> GetOrCopyNullBitmapBuffer(
159 const ArraySpan& in_array, MemoryPool* pool) {
160 if (in_array.buffers[0].data == nullptr) {
161 return nullptr;
162 }
163
164 if (in_array.offset == 0) {
165 return in_array.GetBuffer(0);
166 }
167
168 if (in_array.offset % 8 == 0) {
169 return SliceBuffer(in_array.GetBuffer(0), /*offset=*/in_array.offset / 8);
170 }
171
172 // If a non-zero offset, we need to shift the bitmap
173 return arrow::internal::CopyBitmap(pool, in_array.buffers[0].data, in_array.offset,
174 in_array.length);
175}
176
177} // namespace internal
178} // namespace compute

Callers 4

ExecMethod · 0.85
ExecMethod · 0.85
ExecMethod · 0.85

Calls 3

SliceBufferFunction · 0.85
CopyBitmapFunction · 0.50
GetBufferMethod · 0.45

Tested by

no test coverage detected