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

Function IsValid

cpp/src/arrow/array/array_base.h:62–80  ·  view source on GitHub ↗

\brief Return true if value at index is valid (not null). Does not boundscheck

Source from the content-addressed store, hash-verified

60 /// \brief Return true if value at index is valid (not null). Does not
61 /// boundscheck
62 bool IsValid(int64_t i) const {
63 if (null_bitmap_data_ != NULLPTR) {
64 return bit_util::GetBit(null_bitmap_data_, i + data_->offset);
65 }
66 // Dispatching with a few conditionals like this makes IsNull more
67 // efficient for how it is used in practice. Making IsNull virtual
68 // would add a vtable lookup to every call and prevent inlining +
69 // a potential inner-branch removal.
70 if (type_id() == Type::SPARSE_UNION) {
71 return !internal::IsNullSparseUnion(*data_, i);
72 }
73 if (type_id() == Type::DENSE_UNION) {
74 return !internal::IsNullDenseUnion(*data_, i);
75 }
76 if (type_id() == Type::RUN_END_ENCODED) {
77 return !internal::IsNullRunEndEncoded(*data_, i);
78 }
79 return data_->null_count != data_->length;
80 }
81
82 /// \brief Return a Scalar containing the value of this array at i
83 Result<std::shared_ptr<Scalar>> GetScalar(int64_t i) const;

Callers 1

IsNullFunction · 0.70

Calls 5

IsNullSparseUnionFunction · 0.85
IsNullDenseUnionFunction · 0.85
IsNullRunEndEncodedFunction · 0.85
type_idFunction · 0.70
GetBitFunction · 0.50

Tested by

no test coverage detected