| 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) => {{ |