jayzhan211 commented on code in PR #13133:
URL: https://github.com/apache/datafusion/pull/13133#discussion_r1818076266


##########
datafusion/physical-plan/src/sorts/merge.rs:
##########
@@ -127,12 +148,18 @@ impl<C: CursorValues> SortPreservingMergeStream<C> {
             metrics,
             aborted: false,
             cursors: (0..stream_count).map(|_| None).collect(),
+            prev_cursors: (0..stream_count).map(|_| None).collect(),
+            round_robin_tie_breaker_mode: false,
+            num_of_polled_with_same_value: vec![0; stream_count],

Review Comment:
   I think one challenge is that you assume the next index is p+1, but it could 
be p+r (any number). 
   Consider we have 4 partition with v=100,100,120,100.
   
   We choose 0, 1. And the next one should be 3. But if your approach, it is 
not easy to find the next index with the same value. It is 1+2 in this case, 
and it can also be 1+any number.



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