[refactor](conjuncts) simplify conjuncts in exec node (#19254)

Co-authored-by: yiguolei <yiguolei@gmail.com>
Currently, exec node save exprcontext**, but the object is in object pool, the code is very unclear. we could just use exprcontext*.
This commit is contained in:
yiguolei
2023-05-04 18:04:32 +08:00
committed by GitHub
parent fa7d86efbd
commit 4e4fb33995
29 changed files with 84 additions and 108 deletions

View File

@ -104,9 +104,8 @@ Status ExecNode::init(const TPlanNode& tnode, RuntimeState* state) {
init_runtime_profile(get_name());
if (tnode.__isset.vconjunct) {
_vconjunct_ctx_ptr.reset(new doris::vectorized::VExprContext*);
RETURN_IF_ERROR(doris::vectorized::VExpr::create_expr_tree(_pool, tnode.vconjunct,
_vconjunct_ctx_ptr.get()));
&_vconjunct_ctx_ptr));
}
// create the projections expr
@ -131,8 +130,8 @@ Status ExecNode::prepare(RuntimeState* state) {
_mem_tracker = std::make_unique<MemTracker>("ExecNode:" + _runtime_profile->name(),
_runtime_profile.get(), nullptr, "PeakMemoryUsage");
if (_vconjunct_ctx_ptr) {
RETURN_IF_ERROR((*_vconjunct_ctx_ptr)->prepare(state, intermediate_row_desc()));
if (_vconjunct_ctx_ptr != nullptr) {
RETURN_IF_ERROR(_vconjunct_ctx_ptr->prepare(state, intermediate_row_desc()));
}
RETURN_IF_ERROR(vectorized::VExpr::prepare(_projections, state, intermediate_row_desc()));
@ -145,8 +144,8 @@ Status ExecNode::prepare(RuntimeState* state) {
}
Status ExecNode::alloc_resource(doris::RuntimeState* state) {
if (_vconjunct_ctx_ptr) {
RETURN_IF_ERROR((*_vconjunct_ctx_ptr)->open(state));
if (_vconjunct_ctx_ptr != nullptr) {
RETURN_IF_ERROR(_vconjunct_ctx_ptr->open(state));
}
RETURN_IF_ERROR(vectorized::VExpr::open(_projections, state));
return Status::OK();
@ -178,8 +177,8 @@ void ExecNode::release_resource(doris::RuntimeState* state) {
COUNTER_SET(_rows_returned_counter, _num_rows_returned);
}
if (_vconjunct_ctx_ptr) {
(*_vconjunct_ctx_ptr)->close(state);
if (_vconjunct_ctx_ptr != nullptr) {
_vconjunct_ctx_ptr->close(state);
}
vectorized::VExpr::close(_projections, state);