\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.
| 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 | /// |
no test coverage detected