| 41 | } |
| 42 | |
| 43 | int64_t LogicalDenseUnionNullCount(const ArraySpan& span) { |
| 44 | const auto* dense_union_type = internal::checked_cast<const DenseUnionType*>(span.type); |
| 45 | DCHECK_LE(span.child_data.size(), 128); |
| 46 | |
| 47 | const int8_t* types = span.GetValues<int8_t>(1); // NOLINT |
| 48 | const int32_t* offsets = span.GetValues<int32_t>(2); // NOLINT |
| 49 | int64_t null_count = 0; |
| 50 | for (int64_t i = 0; i < span.length; i++) { |
| 51 | const int8_t child_id = dense_union_type->child_ids()[types[span.offset + i]]; |
| 52 | const int32_t offset = offsets[span.offset + i]; |
| 53 | null_count += span.child_data[child_id].IsNull(offset); |
| 54 | } |
| 55 | return null_count; |
| 56 | } |
| 57 | |
| 58 | } // namespace arrow::union_util |
no test coverage detected