Returns the string value at index `i` from a string array of any type.
(array: &ArrayRef, i: usize)
| 497 | |
| 498 | /// Returns the string value at index `i` from a string array of any type. |
| 499 | fn get_str_value(array: &ArrayRef, i: usize) -> Option<&str> { |
| 500 | if array.is_null(i) { |
| 501 | return None; |
| 502 | } |
| 503 | match array.data_type() { |
| 504 | Utf8 => Some(array.as_string::<i32>().value(i)), |
| 505 | LargeUtf8 => Some(array.as_string::<i64>().value(i)), |
| 506 | Utf8View => Some(array.as_string_view().value(i)), |
| 507 | other => { |
| 508 | debug_assert!(false, "unexpected type in get_str_value: {other:?}"); |
| 509 | None |
| 510 | } |
| 511 | } |
| 512 | } |
| 513 | |
| 514 | fn array_to_string_inner(args: &[ArrayRef]) -> Result<ArrayRef> { |
| 515 | if args.len() < 2 || args.len() > 3 { |
no test coverage detected
searching dependent graphs…