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

Function LogicalNullCount

cpp/src/arrow/util/dict_util.cc:30–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28
29template <typename IndexArrowType>
30int64_t LogicalNullCount(const ArraySpan& span) {
31 const auto* indices_null_bit_map = span.buffers[0].data;
32 const auto& dictionary_span = span.dictionary();
33 const auto* dictionary_null_bit_map = dictionary_span.buffers[0].data;
34
35 using CType = typename IndexArrowType::c_type;
36 const CType* indices_data = span.GetValues<CType>(1);
37 int64_t null_count = 0;
38 for (int64_t i = 0; i < span.length; i++) {
39 if (indices_null_bit_map != nullptr &&
40 !bit_util::GetBit(indices_null_bit_map, i + span.offset)) {
41 null_count++;
42 continue;
43 }
44
45 CType current_index = indices_data[i];
46 if (!bit_util::GetBit(dictionary_null_bit_map,
47 current_index + dictionary_span.offset)) {
48 null_count++;
49 }
50 }
51 return null_count;
52}
53
54} // namespace
55

Callers

nothing calls this directly

Calls 5

GetNullCountMethod · 0.80
index_typeMethod · 0.80
GetBitFunction · 0.70
dictionaryMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected