| 35 | } |
| 36 | |
| 37 | Status SubplanPlanNode::SetContainingSubplan( |
| 38 | FragmentState* state, SubplanPlanNode* ancestor, PlanNode* node) { |
| 39 | node->containing_subplan_ = ancestor; |
| 40 | if (node->tnode_->node_type == TPlanNodeType::SUBPLAN_NODE) { |
| 41 | // Only traverse the first child and not the second one, because the Subplan |
| 42 | // parent of nodes inside it should be 'node' and not 'ancestor'. |
| 43 | RETURN_IF_ERROR(SetContainingSubplan(state, ancestor, node->children_[0])); |
| 44 | } else { |
| 45 | if (node->tnode_->node_type == TPlanNodeType::UNNEST_NODE) { |
| 46 | UnnestPlanNode* unnest_node = reinterpret_cast<UnnestPlanNode*>(node); |
| 47 | RETURN_IF_ERROR(unnest_node->InitCollExprs(state)); |
| 48 | } |
| 49 | int num_children = node->children_.size(); |
| 50 | for (int i = 0; i < num_children; ++i) { |
| 51 | RETURN_IF_ERROR(SetContainingSubplan(state, ancestor, node->children_[i])); |
| 52 | } |
| 53 | } |
| 54 | return Status::OK(); |
| 55 | } |
| 56 | |
| 57 | Status SubplanPlanNode::CreateExecNode(RuntimeState* state, ExecNode** node) const { |
| 58 | ObjectPool* pool = state->obj_pool(); |
nothing calls this directly
no test coverage detected