[fix](union) should open/alloc_resource in sink operator instead of source (#23637)

This commit is contained in:
Jerry Hu
2023-08-30 18:58:59 +08:00
committed by GitHub
parent 6d41272421
commit f7caae08d5
4 changed files with 15 additions and 3 deletions

View File

@ -106,6 +106,12 @@ Status VUnionNode::open(RuntimeState* state) {
Status VUnionNode::alloc_resource(RuntimeState* state) {
SCOPED_TIMER(_runtime_profile->total_time_counter());
std::unique_lock<std::mutex> l(_resource_lock);
if (_resource_allocated) {
return Status::OK();
}
// open const expr lists.
for (const auto& exprs : _const_expr_lists) {
RETURN_IF_ERROR(VExpr::open(exprs, state));
@ -114,7 +120,9 @@ Status VUnionNode::alloc_resource(RuntimeState* state) {
for (const auto& exprs : _child_expr_lists) {
RETURN_IF_ERROR(VExpr::open(exprs, state));
}
return ExecNode::alloc_resource(state);
RETURN_IF_ERROR(ExecNode::alloc_resource(state));
_resource_allocated = true;
return Status::OK();
}
Status VUnionNode::get_next_pass_through(RuntimeState* state, Block* block) {