From 8d7d08ff054ee175cd468b4e150dac713072608f Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Thu, 3 Aug 2023 10:41:55 -0400 Subject: [PATCH] Improve documentation for `sort()` --- datafusion/core/src/physical_plan/sorts/sort.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/datafusion/core/src/physical_plan/sorts/sort.rs b/datafusion/core/src/physical_plan/sorts/sort.rs index a12d2a62315d..ed7af311fb8d 100644 --- a/datafusion/core/src/physical_plan/sorts/sort.rs +++ b/datafusion/core/src/physical_plan/sorts/sort.rs @@ -291,8 +291,12 @@ impl ExternalSorter { /// Returns the final sorted output of all batches inserted via /// [`Self::insert_batch`] as a stream of [`RecordBatch`]es. /// - /// This may be an in memory sort/merge if all input fit into memory, or - /// a streaming merge from spill files on disk. + /// This process could either be: + /// + /// 1. An in-memory sort/merge (if the input fit in memory) + /// + /// 2. A combined streaming merge incorporating both in-memory + /// batches and data from spill files on disk. fn sort(&mut self) -> Result { if self.spilled_before() { let mut streams = vec![];