gruuya commented on code in PR #7180:
URL: https://github.com/apache/arrow-datafusion/pull/7180#discussion_r1286754073


##########
datafusion/core/src/physical_plan/sorts/sort.rs:
##########
@@ -639,15 +614,47 @@ fn write_sorted(
     Ok(())
 }
 
-fn read_spill(sender: Sender<Result<RecordBatch>>, path: &Path) -> Result<()> {
+/// Stream batches from spill files.
+///
+/// Each spill file has one or more batches. Intra-batch order is guaranteed 
(each one is sorted),
+/// but the inter-batch ordering is not guaranteed, hence why we need to 
convert each batch from the
+/// spill to a separate input stream for the merge-sort procedure.

Review Comment:
   Ah, good point; for some reason I thought that only 1 batch gets collected 
from `in_mem_sort_stream` in case of no fetch, even though that is not a given.



-- 
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]

Reply via email to