Copilot commented on code in PR #4599:
URL: https://github.com/apache/datafusion-comet/pull/4599#discussion_r3363070557


##########
native/shuffle/src/partitioners/partitioned_batch_iterator.rs:
##########
@@ -85,19 +86,22 @@ impl<'a> PartitionedBatchIterator<'a> {
             pos: 0,
         }
     }
-}
-
-impl Iterator for PartitionedBatchIterator<'_> {
-    type Item = datafusion::common::Result<RecordBatch>;
 
-    fn next(&mut self) -> Option<Self::Item> {
+    /// Returns the next shuffled batch, recording the gather cost into 
`interleave_time`.
+    pub(crate) fn next(
+        &mut self,
+        interleave_time: &Time,
+    ) -> Option<datafusion::common::Result<RecordBatch>> {

Review Comment:
   `PartitionedBatchIterator` no longer implements Rust's `Iterator`, but it 
now exposes a method named `next(...)`. This is easy to confuse with 
`Iterator::next` and also prevents ergonomic usage like `for batch in iter { 
... }` elsewhere in the crate. Consider either (a) renaming this method to 
something explicit like `next_batch_with_metrics`, or (b) reintroducing an 
`impl Iterator<Item = Result<RecordBatch>>` and pass metrics via a field or 
wrapper type so standard iterator patterns still work.



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