(
source_col: &ArrayRef,
target_inner_field: &FieldRef,
cast_options: &CastOptions,
)
| 234 | } |
| 235 | |
| 236 | fn cast_list_view_column<O: arrow::array::OffsetSizeTrait>( |
| 237 | source_col: &ArrayRef, |
| 238 | target_inner_field: &FieldRef, |
| 239 | cast_options: &CastOptions, |
| 240 | ) -> Result<ArrayRef> { |
| 241 | let source_list = source_col |
| 242 | .as_any() |
| 243 | .downcast_ref::<GenericListViewArray<O>>() |
| 244 | .ok_or_else(|| { |
| 245 | crate::error::DataFusionError::Plan(format!( |
| 246 | "Expected list view array but got {}", |
| 247 | source_col.data_type() |
| 248 | )) |
| 249 | })?; |
| 250 | |
| 251 | let cast_values = cast_column( |
| 252 | source_list.values(), |
| 253 | target_inner_field.data_type(), |
| 254 | cast_options, |
| 255 | )?; |
| 256 | |
| 257 | let result = GenericListViewArray::<O>::try_new( |
| 258 | Arc::clone(target_inner_field), |
| 259 | source_list.offsets().clone(), |
| 260 | source_list.sizes().clone(), |
| 261 | cast_values, |
| 262 | source_list.nulls().cloned(), |
| 263 | )?; |
| 264 | Ok(Arc::new(result)) |
| 265 | } |
| 266 | |
| 267 | fn cast_dictionary_column( |
| 268 | source_col: &ArrayRef, |
nothing calls this directly
no test coverage detected
searching dependent graphs…