MCPcopy Create free account
hub / github.com/apache/impala / CreateTreeInternal

Method CreateTreeInternal

be/src/exprs/expr.cc:75–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75Status Expr::CreateTreeInternal(const vector<TExprNode>& nodes, ObjectPool* pool,
76 Expr* root, int* child_node_idx) {
77 // propagate error case
78 if (*child_node_idx >= nodes.size()) {
79 return Status("Failed to reconstruct expression tree from thrift.");
80 }
81
82 const TExprNode& texpr_node = nodes[*child_node_idx];
83 DCHECK_NE(texpr_node.node_type, TExprNodeType::AGGREGATE_EXPR);
84 ScalarExpr* child_expr;
85 RETURN_IF_ERROR(ScalarExpr::CreateNode(texpr_node, pool, &child_expr));
86 root->children_.push_back(child_expr);
87
88 int num_children = nodes[*child_node_idx].num_children;
89 for (int i = 0; i < num_children; ++i) {
90 *child_node_idx += 1;
91 RETURN_IF_ERROR(CreateTreeInternal(nodes, pool, child_expr, child_node_idx));
92 DCHECK(child_expr->GetChild(i) != nullptr);
93 }
94 return Status::OK();
95}
96
97void Expr::Close() {
98 for (ScalarExpr* child : children_) child->Close();

Callers

nothing calls this directly

Calls 5

OKFunction · 0.85
push_backMethod · 0.80
GetChildMethod · 0.80
StatusClass · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected