MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / synth_rows

Function synth_rows

src/clusterd-test-driver/src/data.rs:122–130  ·  view source on GitHub ↗

Generate `n` synthetic rows for `desc`, with row indices running `start..start + n`. Successive batches over disjoint index ranges produce distinct rows that never consolidate, so a downstream count equals the total rows written (provided the schema carries a wide-enough column; see [`synth_cell`]).

(desc: &RelationDesc, start: u64, n: u64, pad: usize)

Source from the content-addressed store, hash-verified

120/// consolidate, so a downstream count equals the total rows written (provided the
121/// schema carries a wide-enough column; see [`synth_cell`]).
122pub fn synth_rows(desc: &RelationDesc, start: u64, n: u64, pad: usize) -> Vec<Row> {
123 let types: Vec<SqlScalarType> = desc.iter_types().map(|c| c.scalar_type.clone()).collect();
124 (start..start + n)
125 .map(|i| {
126 let cells: Vec<Cell> = types.iter().map(|t| synth_cell(t, i, pad)).collect();
127 pack_cells(&cells)
128 })
129 .collect()
130}
131
132/// Builds `n` rows of the [`sample_desc`] schema; `payload` is `pad` bytes wide so
133/// callers can target a byte budget (≈ `n * (pad + overhead)`).

Callers 3

sample_rows_fromFunction · 0.85
executeMethod · 0.85
schema_parse_and_synthFunction · 0.85

Calls 7

synth_cellFunction · 0.85
pack_cellsFunction · 0.85
iter_typesMethod · 0.80
collectMethod · 0.45
mapMethod · 0.45
cloneMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected