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

Method new_i64str

datafusion/core/tests/fuzz_cases/limit_fuzz.rs:168–195  ·  view source on GitHub ↗

Create two columns of random values (int64, string), with the specified number of rows, sorted the default

(size: usize)

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 8

get_random_stringFunction · 0.85
stagger_batchFunction · 0.85
i64string_batchFunction · 0.85
collectMethod · 0.80
mapMethod · 0.45
cloneMethod · 0.45
lenMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected