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

Method SortInput

be/src/exec/sort-node.cc:223–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221}
222
223Status SortNode::SortInput(RuntimeState* state) {
224 RowBatch batch(child(0)->row_desc(), state->batch_size(), mem_tracker());
225 bool eos;
226 do {
227 RETURN_IF_ERROR(child(0)->GetNext(state, &batch, &eos));
228
229 MonotonicStopWatch timer;
230 timer.Start();
231 Status add_status = sorter_->AddBatch(&batch);
232 timer.Stop();
233 add_batch_timer_->UpdateCounter(timer.ElapsedTime());
234 if (UNLIKELY(!add_status.ok())) return add_status;
235
236 batch.Reset();
237 RETURN_IF_CANCELLED(state);
238 RETURN_IF_ERROR(QueryMaintenance(state));
239 } while(!eos);
240
241 // Unless we are inside a subplan expecting to call Open()/GetNext() on the child
242 // again, the child can be closed at this point to release resources.
243 if (!IsInSubplan()) child(0)->Close(state);
244
245 RETURN_IF_ERROR(sorter_->InputDone());
246 return Status::OK();
247}
248
249}

Callers

nothing calls this directly

Calls 13

OKFunction · 0.85
batch_sizeMethod · 0.80
row_descMethod · 0.45
GetNextMethod · 0.45
StartMethod · 0.45
AddBatchMethod · 0.45
StopMethod · 0.45
UpdateCounterMethod · 0.45
ElapsedTimeMethod · 0.45
okMethod · 0.45
ResetMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected