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

Method CreateTree

be/src/exprs/expr.cc:53–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53Status Expr::CreateTree(const TExpr& texpr, ObjectPool* pool, Expr* root) {
54 DCHECK(!texpr.nodes.empty());
55 DCHECK(root != nullptr);
56 // The root of the tree at nodes[0] is already created and stored in 'root'.
57 int child_node_idx = 0;
58 int num_children = texpr.nodes[0].num_children;
59 for (int i = 0; i < num_children; ++i) {
60 ++child_node_idx;
61 Status status = CreateTreeInternal(texpr.nodes, pool, root, &child_node_idx);
62 if (UNLIKELY(!status.ok())) {
63 LOG(ERROR) << "Could not construct expr tree.\n" << status.GetDetail() << "\n"
64 << apache::thrift::ThriftDebugString(texpr);
65 return status;
66 }
67 }
68 if (UNLIKELY(child_node_idx + 1 != texpr.nodes.size())) {
69 return Status("Expression tree only partially reconstructed. Not all thrift " \
70 "nodes were used.");
71 }
72 return Status::OK();
73}
74
75Status Expr::CreateTreeInternal(const vector<TExprNode>& nodes, ObjectPool* pool,
76 Expr* root, int* child_node_idx) {

Callers

nothing calls this directly

Calls 7

ThriftDebugStringFunction · 0.85
OKFunction · 0.85
GetDetailMethod · 0.80
StatusClass · 0.70
emptyMethod · 0.45
okMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected