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

Method Execute

cpp/src/arrow/compute/exec.cc:639–676  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

637 }
638
639 Status Execute() {
640 if (is_all_null_) {
641 // An all-null value (scalar null or all-null array) gives us a short
642 // circuit opportunity
643 return AllNullShortCircuit();
644 }
645
646 // At this point, by construction we know that all of the values in
647 // arrays_with_nulls_ are arrays that are not all null. So there are a
648 // few cases:
649 //
650 // * No arrays. This is a no-op w/o preallocation but when the bitmap is
651 // pre-allocated we have to fill it with 1's
652 // * One array, whose bitmap can be zero-copied (w/o preallocation, and
653 // when no byte is split) or copied (split byte or w/ preallocation)
654 // * More than one array, we must compute the intersection of all the
655 // bitmaps
656 //
657 // BUT, if the output offset is nonzero for some reason, we copy into the
658 // output unconditionally
659
660 output_->null_count = kUnknownNullCount;
661
662 if (arrays_with_nulls_.empty()) {
663 // No arrays with nulls case
664 output_->null_count = 0;
665 if (bitmap_preallocated_) {
666 bit_util::SetBitsTo(bitmap_, output_->offset, output_->length, true);
667 }
668 return Status::OK();
669 }
670
671 if (arrays_with_nulls_.size() == 1) {
672 return PropagateSingle();
673 }
674
675 return PropagateMultiple();
676 }
677
678 private:
679 KernelContext* ctx_;

Callers 2

PropagateNullsFunction · 0.45
CallFunctionFunction · 0.45

Calls 4

SetBitsToFunction · 0.50
OKFunction · 0.50
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected