HappenLee commented on code in PR #13472: URL: https://github.com/apache/doris/pull/13472#discussion_r1000483532
########## be/src/vec/exec/join/vhash_join_node.cpp: ########## @@ -1237,35 +1300,31 @@ Status HashJoinNode::_hash_table_build(RuntimeState* state) { _hash_table_variants); } -// TODO:: unify the code of extract probe join column -Status HashJoinNode::_extract_build_join_column(Block& block, NullMap& null_map, - ColumnRawPtrs& raw_ptrs, bool& ignore_null, - RuntimeProfile::Counter& expr_call_timer) { +template <bool BuildSide> +Status HashJoinNode::_extract_join_column(Block& block, ColumnUInt8::MutablePtr& null_map, + ColumnRawPtrs& raw_ptrs, + const std::vector<int>& res_col_ids) { + DCHECK_EQ(_build_expr_ctxs.size(), _probe_expr_ctxs.size()); for (size_t i = 0; i < _build_expr_ctxs.size(); ++i) { - int result_col_id = -1; - // execute build column - { - SCOPED_TIMER(&expr_call_timer); - RETURN_IF_ERROR(_build_expr_ctxs[i]->execute(&block, &result_col_id)); - } - - // TODO: opt the column is const - block.get_by_position(result_col_id).column = - block.get_by_position(result_col_id).column->convert_to_full_column_if_const(); - if (_is_null_safe_eq_join[i]) { - raw_ptrs[i] = block.get_by_position(result_col_id).column.get(); + raw_ptrs[i] = block.get_by_position(res_col_ids[i]).column.get(); } else { - auto column = block.get_by_position(result_col_id).column.get(); + auto column = block.get_by_position(res_col_ids[i]).column.get(); if (auto* nullable = check_and_get_column<ColumnNullable>(*column)) { auto& col_nested = nullable->get_nested_column(); auto& col_nullmap = nullable->get_null_map_data(); - ignore_null |= !_build_not_ignore_null[i]; + if constexpr (!BuildSide) { + DCHECK(null_map != nullptr); + VectorizedUtils::update_null_map(null_map->get_data(), col_nullmap); + } if (_build_not_ignore_null[i]) { Review Comment: the logic seems may effect the probe logic? ########## be/src/vec/exec/join/vhash_join_node.cpp: ########## @@ -335,11 +337,6 @@ Status ProcessHashTableProbe<JoinOpType, ignore_null>::do_process(HashTableType& auto& mcol = mutable_block.mutable_columns(); int current_offset = 0; - constexpr auto need_to_set_visited = JoinOpType::value == TJoinOp::RIGHT_ANTI_JOIN || Review Comment: need_to_set_visited = std::is_same_v<Mapped, RowRefListWithFlag> 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