| 62 | |
| 63 | template <typename IndexArrowType> |
| 64 | void 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 |
nothing calls this directly
no test coverage detected