Create two columns of random values (int64, string), with the specified number of rows, sorted the default
(size: usize)
| 166 | /// Create two columns of random values (int64, string), with the specified number of |
| 167 | /// rows, sorted the default |
| 168 | fn new_i64str(size: usize) -> Self { |
| 169 | let mut rng = rng(); |
| 170 | |
| 171 | // 100 distinct values |
| 172 | let strings: Vec<Option<String>> = (0..100) |
| 173 | .map(|_| { |
| 174 | // no nulls for now |
| 175 | Some(get_random_string(16)) |
| 176 | }) |
| 177 | .collect(); |
| 178 | |
| 179 | // form inputs, with only 10 distinct integer values , to force collision checks |
| 180 | let data = (0..size) |
| 181 | .map(|_| { |
| 182 | ( |
| 183 | Some(rng.random_range(0..10)), |
| 184 | strings[rng.random_range(0..strings.len())].clone(), |
| 185 | ) |
| 186 | }) |
| 187 | .collect::<Vec<_>>(); |
| 188 | |
| 189 | let batches = stagger_batch(i64string_batch(data.iter())); |
| 190 | |
| 191 | let mut sorted = data; |
| 192 | sorted.sort_unstable(); |
| 193 | |
| 194 | Self::I64Str { batches, sorted } |
| 195 | } |
| 196 | |
| 197 | /// Return top top `limit` values as a RecordBatch |
| 198 | fn topk_values(&self, limit: usize) -> RecordBatch { |
nothing calls this directly
no test coverage detected