| 280 | } |
| 281 | |
| 282 | void TypedColumnBuffer::appendValidityBulk(BitSpan validity) { |
| 283 | const std::size_t count = validity.bit_length; |
| 284 | if (count == 0) { |
| 285 | return; |
| 286 | } |
| 287 | ensureValidityInitialized(); |
| 288 | |
| 289 | // The validity bitmap covers the last `count` rows that were just appended. |
| 290 | // row_count_ already includes them, so the range is |
| 291 | // [row_count_ - count, row_count_). |
| 292 | const std::size_t start_row = row_count_ - count; |
| 293 | validity_.ensureSize(row_count_); |
| 294 | |
| 295 | for (std::size_t i = 0; i < count; ++i) { |
| 296 | const bool valid = validity.test(i); |
| 297 | if (valid) { |
| 298 | validity_.setValid(start_row + i); |
| 299 | } else { |
| 300 | validity_.setNull(start_row + i); |
| 301 | ++null_count_; |
| 302 | } |
| 303 | } |
| 304 | } |
| 305 | |
| 306 | // --------------------------------------------------------------------------- |
| 307 | // Typed read functions (6 storage types) |