austin362667 commented on code in PR #6671:
URL: https://github.com/apache/arrow-rs/pull/6671#discussion_r1826560668
##########
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:
Nice! Thank you so much @alamb . Sorry.. I'm totally a newbie in StringView.
--
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]