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

Method Prepare

be/src/exec/analytic-eval-node.cc:164–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164Status AnalyticEvalNode::Prepare(RuntimeState* state) {
165 SCOPED_TIMER(runtime_profile_->total_time_counter());
166 RETURN_IF_ERROR(ExecNode::Prepare(state));
167 DCHECK(child(0)->row_desc()->IsPrefixOf(*row_desc()));
168 DCHECK_GE(resource_profile_.min_reservation,
169 resource_profile_.spillable_buffer_size * MIN_REQUIRED_BUFFERS);
170 state_ = state;
171 curr_tuple_pool_.reset(new MemPool(mem_tracker()));
172 prev_tuple_pool_.reset(new MemPool(mem_tracker()));
173 prev_input_tuple_pool_.reset(new MemPool(mem_tracker()));
174 evaluation_timer_ = ADD_TIMER(runtime_profile(), "EvaluationTime");
175
176 DCHECK_EQ(result_tuple_desc_->slots().size(), analytic_fns_.size());
177 RETURN_IF_ERROR(AggFnEvaluator::Create(analytic_fns_, state, pool_, expr_perm_pool(),
178 expr_results_pool(), &analytic_fn_evals_));
179
180 if (partition_by_eq_expr_ != nullptr) {
181 RETURN_IF_ERROR(ScalarExprEvaluator::Create(*partition_by_eq_expr_, state, pool_,
182 expr_perm_pool(), expr_results_pool(), &partition_by_eq_expr_eval_));
183 }
184
185 if (order_by_eq_expr_ != nullptr) {
186 RETURN_IF_ERROR(ScalarExprEvaluator::Create(*order_by_eq_expr_, state, pool_,
187 expr_perm_pool(), expr_results_pool(), &order_by_eq_expr_eval_));
188 }
189
190 // An intermediate tuple that is only allocated once and is reused. 'curr_tuple_' is
191 // initialized in Open() before it is used.
192 curr_tuple_ =
193 Tuple::Create(intermediate_tuple_desc_->byte_size(), expr_perm_pool_.get());
194 dummy_result_tuple_ =
195 Tuple::Create(result_tuple_desc_->byte_size(), expr_perm_pool_.get());
196 return Status::OK();
197}
198
199Status AnalyticEvalNode::Open(RuntimeState* state) {
200 SCOPED_TIMER(runtime_profile_->total_time_counter());

Callers

nothing calls this directly

Calls 9

CreateClass · 0.85
OKFunction · 0.85
total_time_counterMethod · 0.80
IsPrefixOfMethod · 0.80
resetMethod · 0.65
getMethod · 0.65
row_descMethod · 0.45
sizeMethod · 0.45
byte_sizeMethod · 0.45

Tested by

no test coverage detected