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

Function VisitNullBitmapInline

cpp/src/arrow/visit_data_inline.h:284–312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

282template <typename ValidFunc, typename NullFunc>
283 requires std::is_same_v<std::invoke_result_t<ValidFunc>, Status>
284Status VisitNullBitmapInline(const uint8_t* valid_bits, int64_t valid_bits_offset,
285 int64_t num_values, int64_t null_count,
286 ValidFunc&& valid_func, NullFunc&& null_func) {
287 internal::OptionalBitBlockCounter bit_counter(null_count == 0 ? NULLPTR : valid_bits,
288 valid_bits_offset, num_values);
289 int64_t position = 0;
290 int64_t offset_position = valid_bits_offset;
291 while (position < num_values) {
292 internal::BitBlockCount block = bit_counter.NextBlock();
293 if (block.AllSet()) {
294 for (int64_t i = 0; i < block.length; ++i) {
295 ARROW_RETURN_NOT_OK(valid_func());
296 }
297 } else if (block.NoneSet()) {
298 for (int64_t i = 0; i < block.length; ++i) {
299 ARROW_RETURN_NOT_OK(null_func());
300 }
301 } else {
302 for (int64_t i = 0; i < block.length; ++i) {
303 ARROW_RETURN_NOT_OK(bit_util::GetBit(valid_bits, offset_position + i)
304 ? valid_func()
305 : null_func());
306 }
307 }
308 position += block.length;
309 offset_position += block.length;
310 }
311 return Status::OK();
312}
313
314template <typename ValidFunc, typename NullFunc>
315 requires std::is_void_v<std::invoke_result_t<ValidFunc>>

Callers 5

AppendArraySliceMethod · 0.85
VisitMethod · 0.85
DecodeArrowMethod · 0.85
DecodeIndicesSpacedMethod · 0.85
DecodeArrowMethod · 0.85

Calls 5

NextBlockMethod · 0.80
NoneSetMethod · 0.80
OKFunction · 0.70
GetBitFunction · 0.50
AllSetMethod · 0.45

Tested by

no test coverage detected