MCPcopy Create free account
hub / github.com/apache/arrow / LogicalSparseUnionNullCount

Function LogicalSparseUnionNullCount

cpp/src/arrow/util/union_util.cc:28–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26namespace arrow::union_util {
27
28int64_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
43int64_t LogicalDenseUnionNullCount(const ArraySpan& span) {
44 const auto* dense_union_type = internal::checked_cast<const DenseUnionType*>(span.type);

Callers 1

Calls 2

sizeMethod · 0.45
IsNullMethod · 0.45

Tested by

no test coverage detected