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


##########
datafusion/physical-plan/src/sorts/multi_level_merge.rs:
##########
@@ -412,7 +438,24 @@ impl MultiLevelMergeBuilder {
                             );
                         }
 
-                        return Err(err);
+                        // buffer_len == 1 and we still can't seat the minimum 
of 2 streams.
+                        if number_of_spills_to_read_for_current_phase == 0 {
+                            // We couldn't even reserve a single stream - one 
record batch
+                            // is larger than the whole merge budget. That's 
the lone-batch
+                            // case, not the 2-stream merge skew we rescue 
here - surface it.
+                            return Err(err);
+                        }

Review Comment:
   You can can possibly still split batch size into 2, the calculation for 
amount of memory for merge stream is more than what is needed for only 
splitting a batch in 2, so you can try to check if have enough memory for 
splitting in 2 



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