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

Function LogicalDenseUnionNullCount

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

Source from the content-addressed store, hash-verified

41}
42
43int64_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

Callers 1

Calls 2

sizeMethod · 0.45
IsNullMethod · 0.45

Tested by

no test coverage detected