You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "Copilot (via GitHub)" <gi...@apache.org> on 2025/04/18 21:19:07 UTC

Re: [PR] Use `interleave` in hash repartitioning [datafusion]

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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org