MCPcopy Create free account
hub / github.com/apache/arrow-rs / cast_binary_view_to_string_view

Function cast_binary_view_to_string_view

arrow-cast/src/cast/string.rs:374–391  ·  view source on GitHub ↗
(
    array: &dyn Array,
    cast_options: &CastOptions,
)

Source from the content-addressed store, hash-verified

372}
373
374pub(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
394fn cast_string_to_boolean<'a, StrArray>(

Callers 1

cast_with_optionsFunction · 0.85

Calls 7

extend_valid_utf8Function · 0.85
as_binary_viewMethod · 0.80
to_string_viewMethod · 0.80
cloneMethod · 0.45
lenMethod · 0.45
iterMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected