This is an automated email from the ASF dual-hosted git repository.
dheres pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new 6685583dfc Minor: improve documentation to `stagger_batch` (#7754)
6685583dfc is described below
commit 6685583dfccf56967cf834d55846447263ec148d
Author: Andrew Lamb <[email protected]>
AuthorDate: Mon Oct 9 02:44:23 2023 -0400
Minor: improve documentation to `stagger_batch` (#7754)
---
test-utils/src/lib.rs | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/test-utils/src/lib.rs b/test-utils/src/lib.rs
index dfd8782751..e3c96d16ee 100644
--- a/test-utils/src/lib.rs
+++ b/test-utils/src/lib.rs
@@ -70,13 +70,23 @@ pub fn add_empty_batches(
}
/// "stagger" batches: split the batches into random sized batches
+///
+/// For example, if the input batch has 1000 rows, [`stagger_batch`] might
return
+/// multiple batches
+/// ```text
+/// [
+/// RecordBatch(123 rows),
+/// RecordBatch(234 rows),
+/// RecordBatch(634 rows),
+/// ]
+/// ```
pub fn stagger_batch(batch: RecordBatch) -> Vec<RecordBatch> {
let seed = 42;
stagger_batch_with_seed(batch, seed)
}
-/// "stagger" batches: split the batches into random sized batches
-/// using the specified value for a rng seed
+/// "stagger" batches: split the batches into random sized batches using the
+/// specified value for a rng seed. See [`stagger_batch`] for more detail.
pub fn stagger_batch_with_seed(batch: RecordBatch, seed: u64) ->
Vec<RecordBatch> {
let mut batches = vec![];