wutiangan commented on a change in pull request #4165: URL: https://github.com/apache/incubator-doris/pull/4165#discussion_r459832443
########## File path: be/src/exec/blocking_join_node.cpp ########## @@ -34,7 +34,9 @@ BlockingJoinNode::BlockingJoinNode(const std::string& node_name, const DescriptorTbl& descs) : ExecNode(pool, tnode, descs), _node_name(node_name), - _join_op(join_op) { + _join_op(join_op), + _current_left_child_row(nullptr), + _semi_join_staging_row(nullptr){ Review comment: ```suggestion _semi_join_staging_row(nullptr) { ``` ########## File path: be/src/exec/blocking_join_node.cpp ########## @@ -74,14 +76,23 @@ Status BlockingJoinNode::prepare(RuntimeState* state) { _probe_tuple_row_size = num_left_tuples * sizeof(Tuple*); _build_tuple_row_size = num_build_tuples * sizeof(Tuple*); + if (_join_op == TJoinOp::LEFT_ANTI_JOIN || _join_op == TJoinOp::LEFT_SEMI_JOIN || + _join_op == TJoinOp::RIGHT_ANTI_JOIN || _join_op == TJoinOp::RIGHT_SEMI_JOIN || + _join_op == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN) { + _semi_join_staging_row = reinterpret_cast<TupleRow*>( + new char[_probe_tuple_row_size + _build_tuple_row_size]); + } _left_batch.reset(new RowBatch(child(0)->row_desc(), state->batch_size(), mem_tracker())); + _build_batch.reset(new RowBatch(child(1)->row_desc(), state->batch_size(), mem_tracker())); return Status::OK(); } Status BlockingJoinNode::close(RuntimeState* state) { // TODO(zhaochun): avoid double close // if (is_closed()) return Status::OK(); _left_batch.reset(); + _build_batch.reset(); + if (_semi_join_staging_row != nullptr) delete[] _semi_join_staging_row; Review comment: should set _semi_join_staging_row to zero to avoid double close? ########## File path: be/src/exec/blocking_join_node.h ########## @@ -84,11 +88,20 @@ class BlockingJoinNode : public ExecNode { // This should be the same size as the left child tuple row. int _result_tuple_row_size; + /// Row assembled from all lhs and rhs tuples used for evaluating the non-equi-join + /// conjuncts for semi joins. Semi joins only return the lhs or rhs output tuples, + /// so this tuple is temporarily assembled for evaluating the conjuncts. + TupleRow* _semi_join_staging_row; Review comment: now we can't support no-equi-join, will you add no-euqal-join semi join latter? ---------------------------------------------------------------- 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. 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