geoffreyclaude commented on code in PR #26930:
URL: https://github.com/apache/datafusion/pull/26930#discussion_r4493691197
##########
datafusion/physical-plan/src/sorts/sort.rs:
##########
@@ -998,21 +986,27 @@ impl ExternalSorter {
shared_input: Option<Arc<MemoryReservation>>,
) -> Result<SendableRecordBatchStream> {
let schema = batch.schema();
- let stream =
- futures::stream::once(self.sort_run(batch, reservation,
shared_input)?)
- .try_flatten();
+ let stream = futures::stream::once(self.sort_run(
+ batch,
+ reservation,
+ shared_input,
+ false,
+ )?)
+ .try_flatten();
Ok(Box::pin(RecordBatchStreamAdapter::new(schema, stream)))
}
/// Sorts a batch and reserves its complete output before returning a
stream.
- /// The stream releases reservations as its consumer takes each output
batch.
+ /// Reservations release as output is read; parallel preparation reads one
+ /// batch ahead to return spill workspace before the merge builds its
cursor.
Review Comment:
Restored the original with_lookahead documentation, including this caveat.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]