(
array: &dyn Array,
cast_options: &CastOptions,
)
| 372 | } |
| 373 | |
| 374 | pub(crate) fn cast_binary_view_to_string_view( |
| 375 | array: &dyn Array, |
| 376 | cast_options: &CastOptions, |
| 377 | ) -> Result<ArrayRef, ArrowError> { |
| 378 | let array = array.as_binary_view(); |
| 379 | |
| 380 | match array.clone().to_string_view() { |
| 381 | Ok(result) => Ok(Arc::new(result)), |
| 382 | Err(error) => match cast_options.safe { |
| 383 | true => { |
| 384 | let mut builder = StringViewBuilder::with_capacity(array.len()); |
| 385 | extend_valid_utf8(&mut builder, array.iter()); |
| 386 | Ok(Arc::new(builder.finish())) |
| 387 | } |
| 388 | false => Err(error), |
| 389 | }, |
| 390 | } |
| 391 | } |
| 392 | |
| 393 | /// Casts string to boolean |
| 394 | fn cast_string_to_boolean<'a, StrArray>( |
no test coverage detected