| 31 | |
| 32 | template <typename IndexArrowType> |
| 33 | int64_t LogicalNullCount(const ArraySpan& span) { |
| 34 | const auto* indices_valid_bitmap = span.buffers[0].data; |
| 35 | const auto& dictionary_span = span.dictionary(); |
| 36 | const auto* dictionary_valid_bitmap = dictionary_span.buffers[0].data; |
| 37 | |
| 38 | using CType = typename IndexArrowType::c_type; |
| 39 | const CType* indices_data = span.GetValues<CType>(1); |
| 40 | int64_t null_count = 0; |
| 41 | DCHECK_OK(internal::VisitBitRuns( |
| 42 | indices_valid_bitmap, span.offset, span.length, |
| 43 | [=, &null_count](int64_t position, int64_t length, bool valid) { |
| 44 | if (valid) { |
| 45 | // This is a run of valid indicies, so we need to look each of them up |
| 46 | // in the dictionary array to see if they are null |
| 47 | for (int64_t i = position; i < position + length; i++) { |
| 48 | CType index = indices_data[i]; |
| 49 | if (!bit_util::GetBit(dictionary_valid_bitmap, |
| 50 | index + dictionary_span.offset)) { |
| 51 | null_count++; |
| 52 | } |
| 53 | } |
| 54 | } else { |
| 55 | // This is a run of null indices |
| 56 | null_count += length; |
| 57 | } |
| 58 | return Status::OK(); |
| 59 | })); |
| 60 | return null_count; |
| 61 | } |
| 62 | |
| 63 | template <typename IndexArrowType> |
| 64 | void SetLogicalNullBits(const ArraySpan& span, uint8_t* out_bitmap, int64_t out_offset, |
nothing calls this directly
no test coverage detected