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

Function SetLogicalNullBits

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

Source from the content-addressed store, hash-verified

62
63template <typename IndexArrowType>
64void SetLogicalNullBits(const ArraySpan& span, uint8_t* out_bitmap, int64_t out_offset,
65 bool set_on_null) {
66 const auto* indices_valid_bitmap = span.buffers[0].data;
67 const auto& dictionary_span = span.dictionary();
68 const auto* dictionary_valid_bitmap = dictionary_span.buffers[0].data;
69
70 using CType = typename IndexArrowType::c_type;
71 const CType* indices_data = span.GetValues<CType>(1);
72 DCHECK_OK(internal::VisitBitRuns(
73 indices_valid_bitmap, span.offset, span.length,
74 [=](int64_t position, int64_t length, bool valid) {
75 if (valid) {
76 // This is a run of valid indicies, so we need to look each of them up
77 // in the dictionary array to see if they are null
78 for (int64_t i = position; i < position + length; i++) {
79 CType index = indices_data[i];
80 bool is_null = !bit_util::GetBit(dictionary_valid_bitmap,
81 index + dictionary_span.offset);
82 bit_util::SetBitTo(out_bitmap, out_offset + i, is_null == set_on_null);
83 }
84 } else {
85 // This is a run of null indices
86 bit_util::SetBitsTo(out_bitmap, out_offset + position, length, set_on_null);
87 }
88 return Status::OK();
89 }));
90}
91
92} // namespace
93

Callers

nothing calls this directly

Calls 11

VisitBitRunsFunction · 0.85
InvertBitmapFunction · 0.85
GetNullCountMethod · 0.80
index_typeMethod · 0.80
GetBitFunction · 0.70
SetBitToFunction · 0.70
SetBitsToFunction · 0.70
CopyBitmapFunction · 0.70
OKFunction · 0.50
dictionaryMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected