| 113 | } |
| 114 | |
| 115 | Status PlanNode::CreateTree(FragmentState* state, const TPlan& plan, PlanNode** root) { |
| 116 | if (plan.nodes.size() == 0) { |
| 117 | *root = NULL; |
| 118 | return Status::OK(); |
| 119 | } |
| 120 | int node_idx = 0; |
| 121 | Status status = |
| 122 | CreateTreeHelper(state, plan.nodes, NULL, &node_idx, root); |
| 123 | if (status.ok() && node_idx + 1 != plan.nodes.size()) { |
| 124 | status = Status( |
| 125 | "Plan tree only partially reconstructed. Not all thrift nodes were used."); |
| 126 | } |
| 127 | if (!status.ok()) { |
| 128 | LOG(ERROR) << "Could not construct plan tree:\n" |
| 129 | << apache::thrift::ThriftDebugString(plan); |
| 130 | } |
| 131 | return status; |
| 132 | } |
| 133 | |
| 134 | Status PlanNode::CreateTreeHelper(FragmentState* state, |
| 135 | const std::vector<TPlanNode>& tnodes, PlanNode* parent, int* node_idx, |
nothing calls this directly
no test coverage detected