MCPcopy Create free account
hub / github.com/apache/impala / OutputUnmatchedBuildFromHashTable

Method OutputUnmatchedBuildFromHashTable

be/src/exec/partitioned-hash-join-node.cc:775–810  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

773}
774
775void PartitionedHashJoinNode::OutputUnmatchedBuildFromHashTable(RowBatch* out_batch) {
776 DCHECK_ENUM_EQ(probe_state_, ProbeState::OUTPUTTING_UNMATCHED);
777 ScalarExprEvaluator* const* conjunct_evals = conjunct_evals_.data();
778 const int num_conjuncts = conjuncts_.size();
779 RowBatch::Iterator out_batch_iterator(out_batch, out_batch->num_rows());
780
781 while (!out_batch->AtCapacity() && !hash_tbl_iterator_.AtEnd()) {
782 // Output remaining unmatched build rows.
783 if (!hash_tbl_iterator_.IsMatched()) {
784 OutputBuildRow(out_batch, hash_tbl_iterator_.GetRow(), &out_batch_iterator);
785 if (ExecNode::EvalConjuncts(
786 conjunct_evals, num_conjuncts, out_batch_iterator.Get())) {
787 out_batch->CommitLastRow();
788 out_batch_iterator.Next();
789 }
790 hash_tbl_iterator_.SetMatched();
791 }
792 // Move to the next unmatched entry.
793 hash_tbl_iterator_.NextUnmatched();
794 }
795
796 // If we reached the end of the hash table, then there are no other unmatched build
797 // rows for this partition. In that case we need to close the partition, and move to
798 // the next. If we have not reached the end of the hash table, it means that we
799 // reached out_batch capacity and we need to continue to output unmatched build rows,
800 // without closing the partition.
801 if (hash_tbl_iterator_.AtEnd()) {
802 output_build_partitions_.front()->Close(out_batch);
803 output_build_partitions_.pop_front();
804 // Move to the next partition to output unmatched rows.
805 if (!output_build_partitions_.empty()) {
806 hash_tbl_iterator_ =
807 output_build_partitions_.front()->hash_tbl()->FirstUnmatched(ht_ctx_.get());
808 }
809 }
810}
811
812void PartitionedHashJoinNode::OutputBuildRow(
813 RowBatch* out_batch, TupleRow* build_row, RowBatch::Iterator* out_batch_iterator) {

Callers

nothing calls this directly

Calls 15

CommitLastRowMethod · 0.80
NextUnmatchedMethod · 0.80
frontMethod · 0.80
FirstUnmatchedMethod · 0.80
hash_tblMethod · 0.80
getMethod · 0.65
dataMethod · 0.45
sizeMethod · 0.45
num_rowsMethod · 0.45
AtCapacityMethod · 0.45
AtEndMethod · 0.45
IsMatchedMethod · 0.45

Tested by

no test coverage detected