For lists and large lists, truncates the sublist of null values Otherwise returns an error
(array: &ArrayRef)
| 1119 | /// For lists and large lists, truncates the sublist of null values |
| 1120 | /// Otherwise returns an error |
| 1121 | pub fn remove_list_null_values(array: &ArrayRef) -> Result<ArrayRef> { |
| 1122 | // todo: handle list view and map |
| 1123 | match array.data_type() { |
| 1124 | DataType::List(_) => Ok(Arc::new(truncate_list_nulls(array.as_list::<i32>())?)), |
| 1125 | DataType::LargeList(_) => { |
| 1126 | Ok(Arc::new(truncate_list_nulls(array.as_list::<i64>())?)) |
| 1127 | } |
| 1128 | dt => _exec_err!("expected List or LargeList, got {dt}"), |
| 1129 | } |
| 1130 | } |
| 1131 | |
| 1132 | /// Create a new list array where all the nulls point to empty lists |
| 1133 | fn truncate_list_nulls<O: OffsetSizeTrait>( |
searching dependent graphs…