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

Function IsValid

cpp/src/arrow/array/data.h:221–236  ·  view source on GitHub ↗

\brief Return the validity of a given array element For most data types, this will simply query the validity bitmap. For union and run-end-encoded arrays, the underlying child data is queried instead. For dictionary arrays, this reflects the validity of the dictionary index, but the corresponding dictionary value might still be null. For null arrays, this always returns false.

Source from the content-addressed store, hash-verified

219 /// index, but the corresponding dictionary value might still be null.
220 /// For null arrays, this always returns false.
221 bool IsValid(int64_t i) const {
222 if (buffers[0] != NULLPTR) {
223 return bit_util::GetBit(buffers[0]->data(), i + offset);
224 }
225 const auto type = this->type->id();
226 if (type == Type::SPARSE_UNION) {
227 return !internal::IsNullSparseUnion(*this, i);
228 }
229 if (type == Type::DENSE_UNION) {
230 return !internal::IsNullDenseUnion(*this, i);
231 }
232 if (type == Type::RUN_END_ENCODED) {
233 return !internal::IsNullRunEndEncoded(*this, i);
234 }
235 return null_count.load() != length;
236 }
237
238 /// \brief Access a buffer's data as a typed C pointer
239 ///

Callers 1

IsNullFunction · 0.70

Calls 7

IsNullSparseUnionFunction · 0.85
IsNullDenseUnionFunction · 0.85
IsNullRunEndEncodedFunction · 0.85
GetBitFunction · 0.50
dataMethod · 0.45
idMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected