(
array: &ArrayRef,
cast_type: &DataType,
cast_options: &CastOptions<'static>,
)
| 304 | } |
| 305 | |
| 306 | fn cast_array_by_name( |
| 307 | array: &ArrayRef, |
| 308 | cast_type: &DataType, |
| 309 | cast_options: &CastOptions<'static>, |
| 310 | ) -> Result<ArrayRef> { |
| 311 | // If types are already equal, no cast needed |
| 312 | if array.data_type() == cast_type { |
| 313 | return Ok(Arc::clone(array)); |
| 314 | } |
| 315 | |
| 316 | if datafusion_common::nested_struct::requires_nested_struct_cast( |
| 317 | array.data_type(), |
| 318 | cast_type, |
| 319 | ) { |
| 320 | datafusion_common::nested_struct::cast_column(array, cast_type, cast_options) |
| 321 | } else { |
| 322 | ensure_date_array_timestamp_bounds(array, cast_type)?; |
| 323 | Ok(kernels::cast::cast_with_options( |
| 324 | array, |
| 325 | cast_type, |
| 326 | cast_options, |
| 327 | )?) |
| 328 | } |
| 329 | } |
| 330 | |
| 331 | fn ensure_date_array_timestamp_bounds( |
| 332 | array: &ArrayRef, |
no test coverage detected
searching dependent graphs…