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


##########
datafusion/physical-plan/src/sorts/merge.rs:
##########
@@ -327,16 +388,96 @@ impl<C: CursorValues> SortPreservingMergeStream<C> {
         self.loser_tree_adjusted = true;
     }
 
-    /// Attempts to update the loser tree, following winner replacement, if 
possible
+    /// Resets the poll count by incrementing the reset epoch.
+    fn reset_poll_counts(&mut self) {
+        self.current_reset_epoch += 1;
+    }
+
+    /// Handles tie-breaking logic during the adjustment of the loser tree.
+    ///
+    /// When comparing elements from multiple partitions in the 
`update_loser_tree` process, a tie can occur
+    /// between the current winner and a challenger. This function is invoked 
when such a tie needs to be
+    /// resolved according to the round-robin tie-breaker mode.
+    ///
+    /// If round-robin tie-breaking is not active, it is enabled, and the poll 
counts for all elements are reset.

Review Comment:
   ```suggestion
       /// If round-robin tie-breaking is not active and the poll counts for 
all elements are reset.
   ```



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