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

Function IsValid

cpp/src/arrow/array/array_base.h:63–81  ·  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

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