austin362667 commented on code in PR #6671:
URL: https://github.com/apache/arrow-rs/pull/6671#discussion_r1828096619


##########
arrow-string/src/length.rs:
##########
@@ -137,6 +138,22 @@ 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 list = array.as_string_view();
+            let values = (0..list.len())
+                .map(|i| {
+                    if list.is_valid(i) {
+                        list.views()[i] as u32 * 8
+                    } else {
+                        0
+                    }
+                })
+                .collect::<Vec<u32>>();
+            Ok(Arc::new(UInt32Array::new(
+                values.into(),

Review Comment:
   Wow! Thank you so much @tustvold , you are indeed making me better Rust 
programmer. Really appreciate for review. 👍



-- 
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]

Reply via email to