github-actions[bot] commented on code in PR #16166: URL: https://github.com/apache/doris/pull/16166#discussion_r1089878994
########## be/src/vec/exec/join/process_hash_table_probe_impl.h: ########## @@ -409,99 +461,154 @@ Status ProcessHashTableProbe<JoinOpType>::do_process_with_other_join_conjuncts( bool all_match_one = true; int last_probe_index = probe_index; - while (probe_index < probe_rows) { - // ignore null rows - if constexpr (ignore_null && need_null_map_for_probe) { - if ((*null_map)[probe_index]) { - if constexpr (probe_all) { - _items_counts[probe_index++] = (uint32_t)1; - same_to_prev.emplace_back(false); - visited_map.emplace_back(nullptr); - // only full outer / left outer need insert the data of right table + + size_t probe_size = 0; + auto& probe_row_match_iter = hash_table_ctx.probe_row_match_iter; + if (probe_row_match_iter.ok()) { + auto origin_offset = current_offset; + while (probe_row_match_iter.ok()) { + if (LIKELY(current_offset < _build_block_rows.size())) { + _build_block_offsets[current_offset] = probe_row_match_iter->block_offset; + _build_block_rows[current_offset] = probe_row_match_iter->row_num; + } else { + _build_block_offsets.emplace_back(probe_row_match_iter->block_offset); + _build_block_rows.emplace_back(probe_row_match_iter->row_num); + } + visited_map.emplace_back(&probe_row_match_iter->visited); + ++probe_row_match_iter; + if (++current_offset >= _batch_size) { + break; + } + } + same_to_prev.emplace_back(false); + for (int i = 0; i < current_offset - origin_offset - 1; ++i) { + same_to_prev.emplace_back(true); + } + + all_match_one &= (current_offset == 1); + _items_counts[probe_index] = current_offset; + if (!probe_row_match_iter.ok()) { + ++probe_index; + } + probe_size = 1; + } + if (current_offset < _batch_size) { + while (probe_index < probe_rows) { + // ignore null rows + if constexpr (ignore_null && need_null_map_for_probe) { + if ((*null_map)[probe_index]) { + if constexpr (probe_all) { + _items_counts[probe_index++] = (uint32_t)1; + same_to_prev.emplace_back(false); + visited_map.emplace_back(nullptr); + // only full outer / left outer need insert the data of right table + if (LIKELY(current_offset < _build_block_rows.size())) { + _build_block_offsets[current_offset] = -1; + _build_block_rows[current_offset] = -1; + } else { + _build_block_offsets.emplace_back(-1); + _build_block_rows.emplace_back(-1); + } + ++current_offset; + } else { + _items_counts[probe_index++] = (uint32_t)0; + } + all_match_one = false; + if constexpr (probe_all) { + if (current_offset >= _batch_size) { + break; + } + } + continue; + } + } + + auto last_offset = current_offset; + auto find_result = !need_null_map_for_probe + ? key_getter.find_key(hash_table_ctx.hash_table, + probe_index, *_arena) + : (*null_map)[probe_index] + ? decltype(key_getter.find_key(hash_table_ctx.hash_table, + probe_index, + *_arena)) {nullptr, false} + : key_getter.find_key(hash_table_ctx.hash_table, + probe_index, *_arena); + if (probe_index + PREFETCH_STEP < probe_rows) Review Comment: warning: statement should be inside braces [readability-braces-around-statements] ```suggestion if (probe_index + PREFETCH_STEP < probe_rows) { ``` be/src/vec/exec/join/process_hash_table_probe_impl.h:537: ```diff - probe_index + PREFETCH_STEP, *_arena); + probe_index + PREFETCH_STEP, *_arena); + } ``` -- 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