yonipeleg33 commented on code in PR #23606:
URL: https://github.com/apache/datafusion/pull/23606#discussion_r3595735123


##########
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:
   The expect() check seems a bit redundant, just match on the option directly
   ```suggestion
                   if let Some(prev_cursors) = self.prev_cursors.as_mut() {
                       prev_cursors[stream_idx] = taken;
                   }
   ```



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