List/LargeList/FixedSizeList/ListView/LargeListView scalars always have a single element array. This function returns that array
(arr: &dyn Array)
| 773 | /// List/LargeList/FixedSizeList/ListView/LargeListView scalars always have a single element |
| 774 | /// array. This function returns that array |
| 775 | fn first_array_for_list(arr: &dyn Array) -> ArrayRef { |
| 776 | assert_eq!(arr.len(), 1); |
| 777 | if let Some(arr) = arr.as_list_opt::<i32>() { |
| 778 | arr.value(0) |
| 779 | } else if let Some(arr) = arr.as_list_opt::<i64>() { |
| 780 | arr.value(0) |
| 781 | } else if let Some(arr) = arr.as_fixed_size_list_opt() { |
| 782 | arr.value(0) |
| 783 | } else if let Some(arr) = arr.as_list_view_opt::<i32>() { |
| 784 | arr.value(0) |
| 785 | } else if let Some(arr) = arr.as_list_view_opt::<i64>() { |
| 786 | arr.value(0) |
| 787 | } else { |
| 788 | unreachable!( |
| 789 | "Since only List / LargeList / FixedSizeList / ListView / LargeListView are supported, this should never happen" |
| 790 | ) |
| 791 | } |
| 792 | } |
| 793 | |
| 794 | /// Compares two List/LargeList/FixedSizeList/ListView/LargeListView scalars |
| 795 | fn partial_cmp_list(arr1: &dyn Array, arr2: &dyn Array) -> Option<Ordering> { |
no test coverage detected
searching dependent graphs…