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

Method new_str

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

Create an string column of random values, with the specified number of rows, sorted the default

(size: usize)

Source from the content-addressed store, hash-verified

142 /// Create an string column of random values, with the specified number of
143 /// rows, sorted the default
144 fn new_str(size: usize) -> Self {
145 let mut rng = rng();
146 let mut data: Vec<Option<String>> = (0..size / 3)
147 .map(|_| {
148 // no nulls for now
149 Some(get_random_string(16))
150 })
151 .collect();
152
153 // have some repeats (approximately 1/3 of the values are the same)
154 while data.len() < size {
155 data.push(data[rng.random_range(0..data.len())].clone());
156 }
157
158 let batches = stagger_batch(string_batch(data.iter()));
159
160 let mut sorted = data;
161 sorted.sort_unstable();
162
163 Self::Str { batches, sorted }
164 }
165
166 /// Create two columns of random values (int64, string), with the specified number of
167 /// rows, sorted the default

Callers

nothing calls this directly

Calls 9

get_random_stringFunction · 0.85
stagger_batchFunction · 0.85
collectMethod · 0.80
string_batchFunction · 0.70
mapMethod · 0.45
lenMethod · 0.45
pushMethod · 0.45
cloneMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected