(
source_col: &ArrayRef,
target_inner_field: &FieldRef,
cast_options: &CastOptions,
)
| 204 | } |
| 205 | |
| 206 | fn cast_list_column<O: arrow::array::OffsetSizeTrait>( |
| 207 | source_col: &ArrayRef, |
| 208 | target_inner_field: &FieldRef, |
| 209 | cast_options: &CastOptions, |
| 210 | ) -> Result<ArrayRef> { |
| 211 | let source_list = source_col |
| 212 | .as_any() |
| 213 | .downcast_ref::<GenericListArray<O>>() |
| 214 | .ok_or_else(|| { |
| 215 | crate::error::DataFusionError::Plan(format!( |
| 216 | "Expected list array but got {}", |
| 217 | source_col.data_type() |
| 218 | )) |
| 219 | })?; |
| 220 | |
| 221 | let cast_values = cast_column( |
| 222 | source_list.values(), |
| 223 | target_inner_field.data_type(), |
| 224 | cast_options, |
| 225 | )?; |
| 226 | |
| 227 | let result = GenericListArray::<O>::new( |
| 228 | Arc::clone(target_inner_field), |
| 229 | source_list.offsets().clone(), |
| 230 | cast_values, |
| 231 | source_list.nulls().cloned(), |
| 232 | ); |
| 233 | Ok(Arc::new(result)) |
| 234 | } |
| 235 | |
| 236 | fn cast_list_view_column<O: arrow::array::OffsetSizeTrait>( |
| 237 | source_col: &ArrayRef, |
nothing calls this directly
no test coverage detected
searching dependent graphs…