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

Method AddRowToSpilledStream

be/src/exec/grouping-aggregator.cc:573–595  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

571}
572
573bool GroupingAggregator::AddRowToSpilledStream(BufferedTupleStream* stream,
574 TupleRow* __restrict__ row, Status* status) {
575 DCHECK(!stream->is_pinned());
576 if (LIKELY(stream->AddRow(row, status))) return true;
577 if (!status->ok()) return false;
578 // We fail to add a large row due to run out of unused reservation and fail to increase
579 // the reservation. If we don't have the serialize stream, spilling partitions don't
580 // need extra reservation so we can restore the large write page reservation and try
581 // again. The same if we have the serialize stream but all partitions are spilled.
582 if ((!needs_serialize_ || GetNumPinnedPartitions() == 0)
583 && large_write_page_reservation_.GetReservation() > 0) {
584 RestoreLargeWritePageReservation();
585 if (LIKELY(stream->AddRow(row, status))) {
586 // 'stream' is spilled so the large write page should already be spilled after it's
587 // written.
588 SaveLargeWritePageReservation();
589 return true;
590 }
591 DCHECK(!status->ok()) << "Extra reservation not used by AddRow in "
592 << DebugString() << ":\n" << buffer_pool_client()->DebugString();
593 }
594 return false;
595}
596
597template <bool AGGREGATED_ROWS>
598Status GroupingAggregator::AppendSpilledRow(

Callers

nothing calls this directly

Calls 6

DebugStringFunction · 0.50
is_pinnedMethod · 0.45
AddRowMethod · 0.45
okMethod · 0.45
GetReservationMethod · 0.45
DebugStringMethod · 0.45

Tested by

no test coverage detected