Helper function to get [`values`](arrow::array::ListArray::values) from [`ListArray`](arrow::array::ListArray)/[`LargeListArray`](arrow::array::LargeListArray)/[`FixedSizeListArray`](arrow::array::FixedSizeListArray) [`NullArray`](arrow::array::NullArray) can be coerced to `ListType`([`Null`](DataType::Null)), so [`NullArray`](arrow::array::NullArray) is returned For all other types [`exec
(array: &ArrayRef)
| 46 | /// [`NullArray`](arrow::array::NullArray) can be coerced to `ListType`([`Null`](DataType::Null)), so [`NullArray`](arrow::array::NullArray) is returned<br> |
| 47 | /// For all other types [`exec_err`] is raised |
| 48 | pub fn get_list_values(array: &ArrayRef) -> Result<&ArrayRef> { |
| 49 | match array.data_type() { |
| 50 | DataType::Null => Ok(array), |
| 51 | DataType::List(_) => Ok(array.as_list::<i32>().values()), |
| 52 | DataType::LargeList(_) => Ok(array.as_list::<i64>().values()), |
| 53 | DataType::FixedSizeList(..) => Ok(array.as_fixed_size_list().values()), |
| 54 | wrong_type => exec_err!( |
| 55 | "get_list_values expects List/LargeList/FixedSizeList/Null as argument, got {wrong_type:?}" |
| 56 | ), |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | /// Helper function to get [`offsets`](arrow::array::ListArray::offsets) |
| 61 | /// from [`ListArray`](arrow::array::ListArray)/[`LargeListArray`](arrow::array::LargeListArray)/[`FixedSizeListArray`](arrow::array::FixedSizeListArray)<br> |
no test coverage detected
searching dependent graphs…