Casts string to boolean
(
array: &StrArray,
cast_options: &CastOptions,
)
| 392 | |
| 393 | /// Casts string to boolean |
| 394 | fn cast_string_to_boolean<'a, StrArray>( |
| 395 | array: &StrArray, |
| 396 | cast_options: &CastOptions, |
| 397 | ) -> Result<ArrayRef, ArrowError> |
| 398 | where |
| 399 | StrArray: StringArrayType<'a>, |
| 400 | { |
| 401 | let output_array = array |
| 402 | .iter() |
| 403 | .map(|value| match value { |
| 404 | Some(value) => cast_single_string_to_boolean(value, cast_options), |
| 405 | None => Ok(None), |
| 406 | }) |
| 407 | .collect::<Result<BooleanArray, _>>()?; |
| 408 | |
| 409 | Ok(Arc::new(output_array)) |
| 410 | } |
| 411 | |
| 412 | #[inline] |
| 413 | fn cast_single_string_to_boolean( |
no test coverage detected