From a0216341b5fd66e8e8f1b277ab85cd1f88450997 Mon Sep 17 00:00:00 2001 From: zhangstar333 <87313068+zhangstar333@users.noreply.github.com> Date: Mon, 4 Sep 2023 09:48:38 +0800 Subject: [PATCH 1/3] [refactor](join) improve join node output when build table rows is 0 (#23713) --- be/src/vec/exec/join/vhash_join_node.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/be/src/vec/exec/join/vhash_join_node.cpp b/be/src/vec/exec/join/vhash_join_node.cpp index 71ea81a1bd10ba..66fe385207279c 100644 --- a/be/src/vec/exec/join/vhash_join_node.cpp +++ b/be/src/vec/exec/join/vhash_join_node.cpp @@ -568,7 +568,6 @@ Status HashJoinNode::pull(doris::RuntimeState* state, vectorized::Block* output_ reached_limit(output_block, eos); return Status::OK(); } - //TODO: this short circuit maybe could refactor, no need to check at here. if (_empty_right_table_need_probe_dispose) { // when build table rows is 0 and not have other_join_conjunct and join type is one of LEFT_OUTER_JOIN/FULL_OUTER_JOIN/LEFT_ANTI_JOIN From b8e29507cb815d6cd2275097481e314135bee7b8 Mon Sep 17 00:00:00 2001 From: zhangstar333 <87313068+zhangstar333@users.noreply.github.com> Date: Thu, 12 Oct 2023 16:59:52 +0800 Subject: [PATCH 2/3] [Enhancement](filter) support only min/max runtime filter in BE (#25290) this PR #25193 have achieve about FE. eg: select count() from lineorder join supplier on lo_partkey < s_suppkey; will have a max filter after build hash table , so could use it to filter probe table data. --- be/src/vec/exec/join/vhash_join_node.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/be/src/vec/exec/join/vhash_join_node.cpp b/be/src/vec/exec/join/vhash_join_node.cpp index 66fe385207279c..71ea81a1bd10ba 100644 --- a/be/src/vec/exec/join/vhash_join_node.cpp +++ b/be/src/vec/exec/join/vhash_join_node.cpp @@ -568,6 +568,7 @@ Status HashJoinNode::pull(doris::RuntimeState* state, vectorized::Block* output_ reached_limit(output_block, eos); return Status::OK(); } + //TODO: this short circuit maybe could refactor, no need to check at here. if (_empty_right_table_need_probe_dispose) { // when build table rows is 0 and not have other_join_conjunct and join type is one of LEFT_OUTER_JOIN/FULL_OUTER_JOIN/LEFT_ANTI_JOIN From 38b6d16fa2c20b6f2cb90527ef8b1522b5018747 Mon Sep 17 00:00:00 2001 From: zhangstar333 <2561612514@qq.com> Date: Thu, 19 Oct 2023 15:52:01 +0800 Subject: [PATCH 3/3] [bug](cherry-pick) fix bug of converting outer join probe block to nullable --- be/src/vec/exec/join/vhash_join_node.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/be/src/vec/exec/join/vhash_join_node.cpp b/be/src/vec/exec/join/vhash_join_node.cpp index 71ea81a1bd10ba..f6dafef06a74cc 100644 --- a/be/src/vec/exec/join/vhash_join_node.cpp +++ b/be/src/vec/exec/join/vhash_join_node.cpp @@ -725,11 +725,12 @@ Status HashJoinNode::push(RuntimeState* /*state*/, vectorized::Block* input_bloc _probe_columns.resize(probe_expr_ctxs_sz); std::vector res_col_ids(probe_expr_ctxs_sz); - RETURN_IF_ERROR( - _do_evaluate(*input_block, _probe_expr_ctxs, *_probe_expr_call_timer, res_col_ids)); if (_join_op == TJoinOp::RIGHT_OUTER_JOIN || _join_op == TJoinOp::FULL_OUTER_JOIN) { _probe_column_convert_to_null = _convert_block_to_null(*input_block); } + RETURN_IF_ERROR( + _do_evaluate(*input_block, _probe_expr_ctxs, *_probe_expr_call_timer, res_col_ids)); + // TODO: Now we are not sure whether a column is nullable only by ExecNode's `row_desc` // so we have to initialize this flag by the first probe block. if (!_has_set_need_null_map_for_probe) {