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

Function gen_column

src/expr/src/interpret.rs:1399–1423  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1397 }
1398
1399 fn gen_column() -> impl Strategy<Value = (ReprColumnType, Datum<'static>, ResultSpec<'static>)>
1400 {
1401 let col_type = (select(SCALAR_TYPES), any::<bool>())
1402 .prop_map(|(t, b)| t.nullable(b))
1403 .prop_filter("need at least one value", |c| {
1404 SqlScalarType::from_repr(&c.scalar_type)
1405 .interesting_datums()
1406 .count()
1407 > 0
1408 });
1409
1410 let result_spec = select(vec![
1411 ResultSpec::nothing(),
1412 ResultSpec::null(),
1413 ResultSpec::anything(),
1414 ResultSpec::value_all(),
1415 ]);
1416
1417 (col_type, result_spec).prop_flat_map(|(col, result_spec)| {
1418 gen_datums_for_type(&col).prop_map(move |datum| {
1419 let result_spec = result_spec.clone().union(ResultSpec::value(datum));
1420 (col.clone(), datum, result_spec)
1421 })
1422 })
1423 }
1424
1425 fn gen_expr_for_relation(
1426 relation: &ReprRelationType,

Callers 1

gen_expr_dataFunction · 0.85

Calls 7

selectFunction · 0.85
gen_datums_for_typeFunction · 0.85
interesting_datumsMethod · 0.80
nullableMethod · 0.45
countMethod · 0.45
unionMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected