Copilot commented on code in PR #15768:
URL: https://github.com/apache/datafusion/pull/15768#discussion_r2051134690
##########
datafusion/physical-plan/src/repartition/mod.rs:
##########
@@ -260,33 +260,43 @@ impl BatchPartitioner {
} => {
let idx = *next_idx;
*next_idx = (*next_idx + 1) % *num_partitions;
- Box::new(std::iter::once(Ok((idx, batch))))
+ assert_eq!(batches.len(), 1);
+ Box::new(std::iter::once(Ok((idx,
batches.swap_remove(0)))))
Review Comment:
In the RoundRobin branch, an assertion forces batches to contain exactly one
RecordBatch. If multiple batches are ever passed, this assertion will panic.
Consider either handling multiple batches or documenting the assumption to
prevent future misuse.
--
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]