◆ ValidityArray()
| duckdb::ValidityArray::ValidityArray |
( |
| ) |
|
|
inline |
◆ AllValid()
| bool duckdb::ValidityArray::AllValid |
( |
| ) |
const |
|
inline |
9316 {
9317 return !validity_mask;
9318 }
◆ Initialize()
| void duckdb::ValidityArray::Initialize |
( |
idx_t |
count, |
|
|
bool |
initial = true |
|
) |
| |
|
inline |
9320 {
9321 capacity = count;
9322 validity_data = make_unsafe_uniq_array<bool>(count);
9323 validity_mask = validity_data.get();
9324 memset(validity_mask, initial, sizeof(bool) * count);
9325 }
◆ InitializeEmpty()
| void duckdb::ValidityArray::InitializeEmpty |
( |
idx_t |
count | ) |
|
|
inline |
9326 {
9327 capacity = count;
9328 }
◆ Capacity()
| idx_t duckdb::ValidityArray::Capacity |
( |
| ) |
const |
|
inline |
9330 {
9331 return capacity;
9332 }
◆ RowIsValidUnsafe()
| bool duckdb::ValidityArray::RowIsValidUnsafe |
( |
idx_t |
row_idx | ) |
const |
|
inline |
RowIsValidUnsafe should only be used if AllValid() is false: it achieves the same as RowIsValid but skips a not-null check
9336 {
9337 D_ASSERT(validity_mask);
9338 return validity_mask[row_idx];
9339 }
◆ RowIsValid()
| bool duckdb::ValidityArray::RowIsValid |
( |
idx_t |
row_idx | ) |
const |
|
inline |
Returns true if a row is valid (i.e. not null), false otherwise.
9342 {
9343#ifdef DEBUG
9344 if (row_idx >= capacity) {
9345 throw InternalException("ValidityData::RowIsValid - row_idx %d is out-of-range for mask with capacity %llu",
9346 row_idx, capacity);
9347 }
9348#endif
9349 if (!validity_mask) {
9350 return true;
9351 }
9353 }
bool RowIsValidUnsafe(idx_t row_idx) const
Definition duckdb.hpp:9336
◆ SetValidUnsafe()
| void duckdb::ValidityArray::SetValidUnsafe |
( |
idx_t |
row_idx | ) |
|
|
inline |
Same as SetValid, but skips a null check on validity_mask.
9356 {
9357 D_ASSERT(validity_mask);
9358 validity_mask[row_idx] = true;
9359 }
◆ SetValid()
| void duckdb::ValidityArray::SetValid |
( |
idx_t |
row_idx | ) |
|
|
inline |
Marks the entry at the specified row index as valid (i.e. not-null)
9362 {
9363#ifdef DEBUG
9364 if (row_idx >= capacity) {
9365 throw InternalException("ValidityData::SetValid - row_idx %d is out-of-range for mask with capacity %llu",
9366 row_idx, capacity);
9367 }
9368#endif
9369 if (!validity_mask) {
9370
9371
9372 return;
9373 }
9374
9376 }
void SetValidUnsafe(idx_t row_idx)
Same as SetValid, but skips a null check on validity_mask.
Definition duckdb.hpp:9356
◆ Pack()
9378 {
9379 if (AllValid()) {
9381 return;
9382 }
9383 mask.Initialize(count);
9384
9385 const auto entire_entries = count / ValidityMask::BITS_PER_VALUE;
9386 const auto ragged = count % ValidityMask::BITS_PER_VALUE;
9387 auto bits =
mask.GetData();
9388 idx_t row_idx = 0;
9389 for (idx_t i = 0; i < entire_entries; ++i) {
9390 validity_t entry = 0;
9391 for (idx_t j = 0; j < ValidityMask::BITS_PER_VALUE; ++j) {
9393 entry |= validity_t(1) << j;
9394 }
9395 }
9396 *bits++ = entry;
9397 }
9398 if (ragged) {
9399 validity_t entry = 0;
9400 for (idx_t j = 0; j < ragged; ++j) {
9402 entry |= validity_t(1) << j;
9403 }
9404 }
9405 *bits++ = entry;
9406 }
9407 }
GMat mask(const GMat &src, const GMat &mask)
The documentation for this struct was generated from the following file: