MCPcopy Create free account
hub / github.com/apache/datafusion / random_value

Function random_value

benchmarks/src/cancellation.rs:320–332  ·  view source on GitHub ↗
(rng: &mut ThreadRng, column_type: &DataType)

Source from the content-addressed store, hash-verified

318}
319
320fn random_value(rng: &mut ThreadRng, column_type: &DataType) -> ScalarValue {
321 match column_type {
322 DataType::Float64 => ScalarValue::Float64(Some(rng.random())),
323 DataType::Boolean => ScalarValue::Boolean(Some(rng.random())),
324 DataType::Utf8 => ScalarValue::Utf8(Some(
325 rng.sample_iter(&Alphanumeric)
326 .take(10)
327 .map(char::from)
328 .collect(),
329 )),
330 other => unimplemented!("No random value generation implemented for {other:?}"),
331 }
332}

Callers 1

random_dataFunction · 0.85

Calls 3

collectMethod · 0.80
mapMethod · 0.45
takeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…