zuochunwei commented on a change in pull request #8119:
URL: https://github.com/apache/incubator-doris/pull/8119#discussion_r809721353



##########
File path: be/src/vec/exec/join/vhash_join_node.cpp
##########
@@ -284,12 +265,28 @@ struct ProcessHashTableProbe {
             }
             items_counts[_probe_index++] = repeat_count;
             current_offset += repeat_count;
-
             if (current_offset >= _batch_size) {
                 break;
             }
         }
-        
+
+        // insert all match build rows
+        if (_build_block.size() == 1) {
+            for (int i = 0; i < _right_col_len; i++) {
+                    auto &column = *_build_block[0].get_by_position(i).column;

Review comment:
       store _build_block[0] out of the for loop

##########
File path: be/src/vec/exec/join/vhash_join_node.cpp
##########
@@ -284,12 +265,28 @@ struct ProcessHashTableProbe {
             }
             items_counts[_probe_index++] = repeat_count;
             current_offset += repeat_count;
-
             if (current_offset >= _batch_size) {
                 break;
             }
         }
-        
+
+        // insert all match build rows
+        if (_build_block.size() == 1) {
+            for (int i = 0; i < _right_col_len; i++) {
+                    auto &column = *_build_block[0].get_by_position(i).column;
+                for (int j = 0; j < _build_index.size(); j++) {
+                    mcol[i + _right_col_idx]->insert_from(column, 
_build_index[j]);

Review comment:
       mcol[i+_right_col_idx] is not related with inner for loop, so move out 
is better




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to