alamb commented on code in PR #6671:
URL: https://github.com/apache/arrow-rs/pull/6671#discussion_r1826547114
##########
arrow-string/src/length.rs:
##########
@@ -137,6 +137,26 @@ pub fn bit_length(array: &dyn Array) -> Result<ArrayRef,
ArrowError> {
let list = array.as_string::<i64>();
Ok(bit_length_impl::<Int64Type>(list.offsets(), list.nulls()))
}
+ DataType::Utf8View => {
+ let string_view_array = array
+ .as_any()
+ .downcast_ref::<StringViewArray>()
+ .ok_or_else(|| ArrowError::ComputeError("Expected Utf8View
array".to_string()))?;
+ let mut bit_lengths = Vec::with_capacity(array.len());
+ for i in 0..array.len() {
+ let bit_length = if string_view_array.is_valid(i) {
+ (string_view_array.value(i).len() * 8) as i32
Review Comment:
I tried to find docs on how to work with the views and I didn't find
anything good - so I made a PR to add an example:
https://github.com/apache/arrow-rs/pull/6673
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]