BiteTheDDDDt commented on code in PR #50720:
URL: https://github.com/apache/doris/pull/50720#discussion_r2083778815
##########
be/src/pipeline/exec/join/process_hash_table_probe_impl.h:
##########
@@ -521,6 +532,75 @@ Status
ProcessHashTableProbe<JoinOpType>::do_mark_join_conjuncts(vectorized::Blo
return finalize_block_with_filter(output_block, result_column_id,
result_column_id);
}
+template <int JoinOpType>
+Status ProcessHashTableProbe<JoinOpType>::do_right_half_mark_join_conjuncts(
+ vectorized::Block* output_block) {
+ DCHECK(JoinOpType == TJoinOp::RIGHT_SEMI_JOIN || JoinOpType ==
TJoinOp::RIGHT_ANTI_JOIN)
+ << "JoinOpType is not right semi join or anti join: " <<
JoinOpType;
+
+ const auto row_count = output_block->rows();
+ if (!row_count) {
+ return Status::OK();
+ }
+
+ auto mark_column_mutable =
+
output_block->get_by_position(_parent->_mark_column_id).column->assume_mutable();
+ auto& mark_column =
assert_cast<vectorized::ColumnNullable&>(*mark_column_mutable);
+ vectorized::IColumn::Filter& filter =
+
assert_cast<vectorized::ColumnUInt8&>(mark_column.get_nested_column()).get_data();
+ RETURN_IF_ERROR(
+
vectorized::VExprContext::execute_conjuncts(_parent->_mark_join_conjuncts,
output_block,
+
mark_column.get_null_map_column(), filter));
+ uint8_t* mark_filter_data = filter.data();
+ uint8_t* mark_null_map = mark_column.get_null_map_data().data();
+
+ // for non null aware join, build_indexs is 0 which means there is no match
+ // sometimes null will be returned in conjunct, but it should not actually
be null.
+ for (size_t i = 0; i != row_count; ++i) {
+ mark_null_map[i] &= _build_indexs.get_element(i) != 0;
+ }
+
+ if (_have_other_join_conjunct) {
+ vectorized::IColumn::Filter other_conjunct_filter(row_count, 1);
+ {
+ bool can_be_filter_all = false;
+ RETURN_IF_ERROR(vectorized::VExprContext::execute_conjuncts(
+ _parent->_other_join_conjuncts, nullptr, output_block,
&other_conjunct_filter,
+ &can_be_filter_all));
+ }
+ DCHECK_EQ(filter.size(), other_conjunct_filter.size());
+ const auto* other_filter_data = other_conjunct_filter.data();
+ for (size_t i = 0; i != filter.size(); ++i) {
+ // null & any(true or false) => null => false
Review Comment:
maybe we can abstract part which similar with `do_mark_join_conjuncts` to
reuse code ?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]