Skip to main content

subdivide_partition

Function subdivide_partition 

Source
pub fn subdivide_partition(
    p: &Partition,
    n: u64,
) -> Result<Vec<Partition>, String>
Expand description

Split a resolved Partition into n contiguous sub-partitions whose sizes differ by at most one ordinal — the value-level form of the */N spec token (identical boundary math via split_evenly). Indices restart at 0, count is n, base_extent propagates, and the pct fields interpolate the parent’s span.

Errors when n is 0 or exceeds the partition’s cardinality (every sub-partition must be non-empty). This is the shared engine behind the subdivide(p, n) stdlib node (which panics per node convention) and the comprehension-source form (for: "inner in subdivide(outer, n)", which surfaces the error as a clause diagnostic).