MCPcopy Create free account
hub / github.com/apache/arrow-rs / length_cases_string

Function length_cases_string

arrow-string/src/length.rs:204–222  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

202 use arrow_schema::Field;
203
204 fn length_cases_string() -> Vec<(Vec<&'static str>, usize, Vec<i32>)> {
205 // a large array
206 let values = [
207 "one",
208 "on",
209 "o",
210 "",
211 "this is a longer string to test string array with",
212 ];
213 let values = values.into_iter().cycle().take(4096).collect();
214 let expected = [3, 2, 1, 0, 49].into_iter().cycle().take(4096).collect();
215
216 vec![
217 (vec!["hello", " ", "world"], 3, vec![5, 1, 5]),
218 (vec!["hello", " ", "world", "!"], 4, vec![5, 1, 5, 1]),
219 (vec!["💖"], 1, vec![4]),
220 (values, 4096, expected),
221 ]
222 }
223
224 macro_rules! length_binary_helper {
225 ($offset_ty: ty, $result_ty: ty, $kernel: ident, $value: expr, $expected: expr) => {{

Callers 3

length_test_stringFunction · 0.85
length_test_large_stringFunction · 0.85
length_test_string_viewFunction · 0.85

Calls 3

collectMethod · 0.80
takeMethod · 0.45
into_iterMethod · 0.45

Tested by 3

length_test_stringFunction · 0.68
length_test_large_stringFunction · 0.68
length_test_string_viewFunction · 0.68