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

Method Init

be/src/exec/unpivot-node.cc:35–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33namespace impala {
34
35Status UnpivotPlanNode::Init(const TPlanNode& tnode, FragmentState* state) {
36 DCHECK(tnode.__isset.unpivot_node);
37 RETURN_IF_ERROR(PlanNode::Init(tnode, state));
38 DCHECK(tnode.row_tuples.size() == 1);
39 tuple_desc_ = state->desc_tbl().GetTupleDescriptor(tnode.row_tuples[0]);
40 RETURN_IF_ERROR(ScalarExpr::Create(tnode.unpivot_node.source_exprs,
41 *(children_[0]->row_descriptor_), state, &source_exprs_));
42 DCHECK_EQ(tuple_desc_->slots().size(), source_exprs_.size());
43 num_unpivot_columns_ = tnode.unpivot_node.num_unpivot_columns;
44 if (tnode.unpivot_node.__isset.data_slot_id) {
45 data_slot_id_ = tnode.unpivot_node.data_slot_id;
46 DCHECK(tnode.unpivot_node.__isset.data_exprs);
47 RETURN_IF_ERROR(ScalarExpr::Create(tnode.unpivot_node.data_exprs,
48 *(children_[0]->row_descriptor_), state, &data_exprs_));
49 }
50 if (tnode.unpivot_node.__isset.header_slot_id) {
51 header_slot_id_ = tnode.unpivot_node.header_slot_id;
52 DCHECK(tnode.unpivot_node.__isset.header_exprs);
53 RETURN_IF_ERROR(ScalarExpr::Create(tnode.unpivot_node.header_exprs,
54 *(children_[0]->row_descriptor_), state, &header_exprs_));
55 }
56 return Status::OK();
57}
58
59void UnpivotPlanNode::Close() {
60 for (auto expr : source_exprs_) {

Callers

nothing calls this directly

Calls 4

CreateClass · 0.85
OKFunction · 0.85
GetTupleDescriptorMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected