From 27ab828fde608a9d71528ad215ed8a6b355ba4af Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Fri, 6 Oct 2023 07:36:43 -0400 Subject: [PATCH] Minor: improve documentation to `stagger_batch` --- 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 dfd878275181c..e3c96d16eeb9c 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 { 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 { let mut batches = vec![];