| 705 | } |
| 706 | |
| 707 | void 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 |
nothing calls this directly
no test coverage detected