| 28 | |
| 29 | template <typename IndexArrowType> |
| 30 | int64_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 |
nothing calls this directly
no test coverage detected