| 26 | namespace arrow::union_util { |
| 27 | |
| 28 | int64_t LogicalSparseUnionNullCount(const ArraySpan& span) { |
| 29 | const auto* sparse_union_type = |
| 30 | internal::checked_cast<const SparseUnionType*>(span.type); |
| 31 | DCHECK_LE(span.child_data.size(), 128); |
| 32 | |
| 33 | const int8_t* types = span.GetValues<int8_t>(1); // NOLINT |
| 34 | int64_t null_count = 0; |
| 35 | for (int64_t i = 0; i < span.length; i++) { |
| 36 | const int8_t child_id = sparse_union_type->child_ids()[types[i]]; |
| 37 | |
| 38 | null_count += span.child_data[child_id].IsNull(span.offset + i); |
| 39 | } |
| 40 | return null_count; |
| 41 | } |
| 42 | |
| 43 | int64_t LogicalDenseUnionNullCount(const ArraySpan& span) { |
| 44 | const auto* dense_union_type = internal::checked_cast<const DenseUnionType*>(span.type); |
no test coverage detected