Create an f64 column of random values, with the specified number of rows, sorted the default
(size: usize)
| 118 | /// Create an f64 column of random values, with the specified number of |
| 119 | /// rows, sorted the default |
| 120 | fn new_f64(size: usize) -> Self { |
| 121 | let mut rng = rng(); |
| 122 | let mut data: Vec<Option<f64>> = (0..size / 3) |
| 123 | .map(|_| { |
| 124 | // no nulls for now |
| 125 | Some(rng.random_range(0.0..1.0f64)) |
| 126 | }) |
| 127 | .collect(); |
| 128 | |
| 129 | // have some repeats (approximately 1/3 of the values are the same) |
| 130 | while data.len() < size { |
| 131 | data.push(data[rng.random_range(0..data.len())]); |
| 132 | } |
| 133 | |
| 134 | let batches = stagger_batch(f64_batch(data.iter().cloned())); |
| 135 | |
| 136 | let mut sorted = data; |
| 137 | sorted.sort_by(|a, b| a.partial_cmp(b).unwrap()); |
| 138 | |
| 139 | Self::F64 { batches, sorted } |
| 140 | } |
| 141 | |
| 142 | /// Create an string column of random values, with the specified number of |
| 143 | /// rows, sorted the default |
nothing calls this directly
no test coverage detected