Skip to main content

build_offsets

Function build_offsets 

Source
pub fn build_offsets(row_count: u32, stream_rows: u32) -> Vec<u32>
Expand description

Computes row offset boundaries for streaming chunk-based processing.

Given a total row_count and stream_rows (chunk size), returns a sorted vector of offsets for use with windows(2) to form [start, end) pairs. If stream_rows is 0, it is treated as 1.

ยงExample

let offsets = build_offsets(25, 10);
assert_eq!(offsets, vec![0, 10, 20, 25]);
// Produces pairs: [0,10), [10,20), [20,25)