ariel-miculas commented on code in PR #23606:
URL: https://github.com/apache/datafusion/pull/23606#discussion_r3595769415


##########
datafusion/physical-plan/src/sorts/merge.rs:
##########
@@ -375,7 +396,10 @@ impl<C: CursorValues> SortPreservingMergeStream<C> {
             let _ = cursor.advance();
             if cursor.is_finished() {
                 // Take the current cursor, leaving `None` in its place
-                self.prev_cursors[stream_idx] = 
self.cursors[stream_idx].take();
+                let taken = self.cursors[stream_idx].take();
+                if self.enable_round_robin_tie_breaker {
+                    self.prev_cursors.as_mut().expect("prev_cursor should be 
set when round robin tie breaker is enabled")[stream_idx] = taken;
+                }

Review Comment:
   this would silently break if for some reason a None would end up in 
prev_cursors, I prefer to fail loudly



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