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

Function VisitNullBitmapInline

cpp/src/arrow/visit_data_inline.h:277–306  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

275
276template <typename ValidFunc, typename NullFunc>
277typename internal::call_traits::enable_if_return<ValidFunc, Status>::type
278VisitNullBitmapInline(const uint8_t* valid_bits, int64_t valid_bits_offset,
279 int64_t num_values, int64_t null_count, ValidFunc&& valid_func,
280 NullFunc&& null_func) {
281 internal::OptionalBitBlockCounter bit_counter(null_count == 0 ? NULLPTR : valid_bits,
282 valid_bits_offset, num_values);
283 int64_t position = 0;
284 int64_t offset_position = valid_bits_offset;
285 while (position < num_values) {
286 internal::BitBlockCount block = bit_counter.NextBlock();
287 if (block.AllSet()) {
288 for (int64_t i = 0; i < block.length; ++i) {
289 ARROW_RETURN_NOT_OK(valid_func());
290 }
291 } else if (block.NoneSet()) {
292 for (int64_t i = 0; i < block.length; ++i) {
293 ARROW_RETURN_NOT_OK(null_func());
294 }
295 } else {
296 for (int64_t i = 0; i < block.length; ++i) {
297 ARROW_RETURN_NOT_OK(bit_util::GetBit(valid_bits, offset_position + i)
298 ? valid_func()
299 : null_func());
300 }
301 }
302 position += block.length;
303 offset_position += block.length;
304 }
305 return Status::OK();
306}
307
308template <typename ValidFunc, typename NullFunc>
309typename internal::call_traits::enable_if_return<ValidFunc, void>::type

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