You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/08/21 21:28:53 UTC

[GitHub] [arrow-rs] jhorstmann commented on a diff in pull request #2521: Improve performance of `%pat%` (>3x speedup)

jhorstmann commented on code in PR #2521:
URL: https://github.com/apache/arrow-rs/pull/2521#discussion_r950902502


##########
arrow/src/compute/kernels/comparison.rs:
##########
@@ -263,11 +263,23 @@ pub fn like_utf8_scalar<OffsetSize: OffsetSizeTrait>(
     } 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);
             }
         }
+    } else if right.starts_with('%')
+        && right.ends_with('%')

Review Comment:
   like supports escape characters now (#2258), so I think this also needs to check that the string does not end with '\\%'



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org