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

Function validate_string_view

arrow-data/src/byte_view.rs:153–162  ·  view source on GitHub ↗

Validates the combination of `views` and `buffers` is a valid StringView

(views: &[u128], buffers: &[Buffer])

Source from the content-addressed store, hash-verified

151
152/// Validates the combination of `views` and `buffers` is a valid StringView
153pub fn validate_string_view(views: &[u128], buffers: &[Buffer]) -> Result<(), ArrowError> {
154 validate_view_impl(views, buffers, |idx, b| {
155 std::str::from_utf8(b).map_err(|e| {
156 ArrowError::InvalidArgumentError(format!(
157 "Encountered non-UTF-8 data at index {idx}: {e}"
158 ))
159 })?;
160 Ok(())
161 })
162}
163
164fn validate_view_impl<F>(views: &[u128], buffers: &[Buffer], f: F) -> Result<(), ArrowError>
165where

Callers 2

validateMethod · 0.85
validate_valuesMethod · 0.85

Calls 1

validate_view_implFunction · 0.85

Tested by

no test coverage detected