tustvold commented on code in PR #2591:
URL: https://github.com/apache/arrow-rs/pull/2591#discussion_r955754295


##########
arrow/src/compute/kernels/comparison.rs:
##########
@@ -260,17 +259,21 @@ pub fn like_utf8_scalar<OffsetSize: OffsetSizeTrait>(
         // fast path, can use starts_with
         let starts_with = &right[..right.len() - 1];
         for i in 0..left.len() {
-            if left.value(i).starts_with(starts_with) {
-                bit_util::set_bit(bool_slice, i);
+            unsafe {
+                if left.value_unchecked(i).starts_with(starts_with) {
+                    bit_util::set_bit(bool_slice, i);
+                }
             }
         }
     } else if right.starts_with('%') && !right[1..].contains(is_like_pattern) {
         // fast path, can use ends_with
         let ends_with = &right[1..];
 
         for i in 0..left.len() {
-            if left.value(i).ends_with(ends_with) {
-                bit_util::set_bit(bool_slice, i);
+            unsafe {
+                if left.value_unchecked(i).ends_with(ends_with) {
+                    bit_util::set_bit(bool_slice, i);

Review Comment:
   Not something for this PR but using MutableBuffer::from_trusted_len_iter may 
be significantly faster as it performs byte-size writes instead bit



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