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

Function random_data

benchmarks/src/cancellation.rs:314–318  ·  view source on GitHub ↗
(column_type: &DataType, rows: usize)

Source from the content-addressed store, hash-verified

312}
313
314fn random_data(column_type: &DataType, rows: usize) -> Arc<dyn Array> {
315 let mut rng = rand::rng();
316 let values = (0..rows).map(|_| random_value(&mut rng, column_type));
317 ScalarValue::iter_to_array(values).unwrap()
318}
319
320fn random_value(rng: &mut ThreadRng, column_type: &DataType) -> ScalarValue {
321 match column_type {

Callers 1

generate_dataFunction · 0.85

Calls 2

random_valueFunction · 0.85
mapMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…