| 553 | } |
| 554 | |
| 555 | Status AllNullShortCircuit() { |
| 556 | // OK, the output should be all null |
| 557 | output_->null_count = output_->length; |
| 558 | |
| 559 | if (bitmap_preallocated_) { |
| 560 | bit_util::SetBitsTo(bitmap_, output_->offset, output_->length, false); |
| 561 | return Status::OK(); |
| 562 | } |
| 563 | |
| 564 | // Walk all the values with nulls instead of breaking on the first in case |
| 565 | // we find a bitmap that can be reused in the non-preallocated case |
| 566 | for (const ArraySpan* arr : arrays_with_nulls_) { |
| 567 | if (arr->null_count == arr->length && arr->buffers[0].owner != nullptr) { |
| 568 | // Reuse this all null bitmap |
| 569 | output_->buffers[0] = arr->GetBuffer(0); |
| 570 | return Status::OK(); |
| 571 | } |
| 572 | } |
| 573 | |
| 574 | RETURN_NOT_OK(EnsureAllocated()); |
| 575 | bit_util::SetBitsTo(bitmap_, output_->offset, output_->length, false); |
| 576 | return Status::OK(); |
| 577 | } |
| 578 | |
| 579 | Status PropagateSingle() { |
| 580 | // One array |