MCPcopy Create free account
hub / github.com/bytedance/bolt / addInput

Method addInput

bolt/exec/HashProbe.cpp:707–823  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

705}
706
707void HashProbe::addInput(RowVectorPtr input) {
708 if (skipInput_) {
709 BOLT_CHECK_NULL(input_);
710 return;
711 }
712 input_ = std::move(input);
713
714 // Reset passingInputRowsInitialized_ as input_ as changed.
715 passingInputRowsInitialized_ = false;
716
717 const auto numInput = input_->size();
718
719 if (numInput > 0) {
720 noInput_ = false;
721 }
722
723 if (canReplaceWithDynamicFilter_) {
724 replacedWithDynamicFilter_ = true;
725 return;
726 }
727
728 bool hasDecoded = false;
729
730 if (needSpillInput()) {
731 if (isRightSemiProjectJoin(joinType_) && !probeSideHasNullKeys_) {
732 decodeAndDetectNonNullKeys();
733 hasDecoded = true;
734 }
735
736 spillInput(input_);
737 // Check if all the probe input rows have been spilled.
738 if (input_ == nullptr) {
739 return;
740 }
741 }
742
743 if (table_->numDistinct() == 0) {
744 if (skipProbeOnEmptyBuild()) {
745 BOLT_CHECK(needSpillInput());
746 input_ = nullptr;
747 return;
748 }
749 // Build side is empty. This state is valid only for anti, left and full
750 // joins.
751 BOLT_CHECK(
752 isAntiJoin(joinType_) || isLeftJoin(joinType_) ||
753 isFullJoin(joinType_) || isLeftSemiProjectJoin(joinType_));
754 if (isLeftSemiProjectJoin(joinType_) ||
755 (isAntiJoin(joinType_) && filter_)) {
756 // For anti join with filter and semi project join we need to decode the
757 // join keys columns to initialize 'nonNullInputRows_'. The anti join
758 // filter evaluation and semi project join output generation will access
759 // 'nonNullInputRows_' later.
760 decodeAndDetectNonNullKeys();
761 }
762 return;
763 }
764

Callers

nothing calls this directly

Calls 15

isRightSemiProjectJoinFunction · 0.85
isAntiJoinFunction · 0.85
isLeftJoinFunction · 0.85
isFullJoinFunction · 0.85
isLeftSemiProjectJoinFunction · 0.85
countSelectedMethod · 0.80
prepareForJoinProbeMethod · 0.80
joinProbeMethod · 0.80
backMethod · 0.80
iotaFunction · 0.50
sizeMethod · 0.45
numDistinctMethod · 0.45

Tested by

no test coverage detected