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

Method GetNextBatch

be/src/runtime/sorter.cc:481–502  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

479}
480
481Status Sorter::Run::GetNextBatch(RowBatch** output_batch) {
482 DCHECK(buffered_batch_ != nullptr);
483 buffered_batch_->Reset();
484 // Fill more rows into buffered_batch_.
485 bool eos;
486 if (HasVarLenPages() && !is_pinned_) {
487 RETURN_IF_ERROR(GetNext<true>(buffered_batch_.get(), &eos));
488 } else {
489 RETURN_IF_ERROR(GetNext<false>(buffered_batch_.get(), &eos));
490 }
491
492 if (eos) {
493 // Setting output_batch to nullptr signals eos to the caller, so GetNext() is not
494 // allowed to attach resources to the batch on eos.
495 DCHECK_EQ(buffered_batch_->num_rows(), 0);
496 DCHECK_EQ(buffered_batch_->num_buffers(), 0);
497 *output_batch = nullptr;
498 return Status::OK();
499 }
500 *output_batch = buffered_batch_.get();
501 return Status::OK();
502}
503
504template <bool CONVERT_OFFSET_TO_PTR>
505Status Sorter::Run::GetNext(RowBatch* output_batch, bool* eos) {

Callers

nothing calls this directly

Calls 5

OKFunction · 0.85
num_buffersMethod · 0.80
getMethod · 0.65
ResetMethod · 0.45
num_rowsMethod · 0.45

Tested by

no test coverage detected