rluvaton commented on code in PR #23286:
URL: https://github.com/apache/datafusion/pull/23286#discussion_r3570398114


##########
datafusion/physical-plan/src/sorts/multi_level_merge.rs:
##########
@@ -245,37 +270,52 @@ impl MultiLevelMergeBuilder {
             (0, 0) => {
                 let empty_stream =
                     
Box::pin(EmptyRecordBatchStream::new(Arc::clone(&self.schema)));
-                Ok(MergeStep::Stream(self.observe_output(empty_stream)))
+                Ok(MergeStep::Stream {
+                    stream: self.observe_output(empty_stream),
+                    batch_size_limit: self.batch_size,
+                })
             }
 
             // Only in-memory stream, return that
             (0, 1) => {
                 let output_stream = self.sorted_streams.remove(0);
-                Ok(MergeStep::Stream(self.observe_output(output_stream)))
+                Ok(MergeStep::Stream {
+                    stream: self.observe_output(output_stream),
+                    batch_size_limit: self.batch_size,
+                })
             }
 
             // Only single sorted spill file so return it
             (1, 0) => {
-                let spill_file = self.sorted_spill_files.remove(0);
+                let (spill_file, _) = self.sorted_spill_files.remove(0);
 
                 // Not reserving any memory for this disk as we are not 
holding it in memory
                 let output_stream = self
                     .spill_manager
                     .read_spill_as_stream(spill_file.file, None)?;
 
-                Ok(MergeStep::Stream(self.observe_output(output_stream)))
+                Ok(MergeStep::Stream {
+                    stream: self.observe_output(output_stream),
+                    batch_size_limit: self.batch_size,

Review Comment:
   the stream should return the spill batch size



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

Reply via email to