Skip to content

Commit

Permalink
Minor: improve documentation to stagger_batch (apache#7754)
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb authored Oct 9, 2023
1 parent 258a7cd commit 6685583
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions test-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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![];

Expand Down

0 comments on commit 6685583

Please sign in to comment.