[fix](union) should open/alloc_resource in sink operator instead of source (#23637)
This commit is contained in:
@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user