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

Method PrepareForOutput

be/src/exec/topn-node.cc:632–647  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

630}
631
632Status TopNNode::PrepareForOutput(RuntimeState* state) {
633 if (is_partitioned()) {
634 // Dump all rows into the sorter and sort by partition, so that we can iterate
635 // through the rows and build heaps partition-by-partition.
636 RETURN_IF_ERROR(EvictPartitions(state, /*evict_final=*/true));
637 DCHECK(partition_heaps_.empty());
638 RETURN_IF_ERROR(sorter_->InputDone());
639 sort_out_batch_.reset(
640 new RowBatch(row_desc(), state->batch_size(), mem_tracker()));
641 } else {
642 DCHECK(heap_->DCheckConsistency());
643 heap_->PrepareForOutput(*this, &sorted_top_n_);
644 get_next_iter_ = sorted_top_n_.begin();
645 }
646 return Status::OK();
647}
648
649void TopNNode::Heap::PrepareForOutput(
650 const TopNNode& RESTRICT node, vector<Tuple*>* sorted_top_n) RESTRICT {

Callers 1

EvictPartitionsMethod · 0.80

Calls 11

OKFunction · 0.85
batch_sizeMethod · 0.80
resizeMethod · 0.80
resetMethod · 0.65
emptyMethod · 0.45
InputDoneMethod · 0.45
DCheckConsistencyMethod · 0.45
beginMethod · 0.45
sizeMethod · 0.45
EmptyMethod · 0.45
PopMethod · 0.45

Tested by

no test coverage detected