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 2021/12/22 15:18:20 UTC

[GitHub] [arrow-rs] alamb commented on a change in pull request #1085: Fix like regex escaping

alamb commented on a change in pull request #1085:
URL: https://github.com/apache/arrow-rs/pull/1085#discussion_r773965887



##########
File path: arrow/src/compute/kernels/comparison.rs
##########
@@ -259,14 +259,14 @@ where
     let mut result = BooleanBufferBuilder::new(left.len());
     for i in 0..left.len() {
         let haystack = left.value(i);
-        let pat = right.value(i);
-        let re = if let Some(ref regex) = map.get(pat) {
+        let pat = escape(right.value(i));
+        let re = if let Some(ref regex) = map.get(&pat) {
             regex
         } else {
             let re_pattern = pat.replace("%", ".*").replace("_", ".");

Review comment:
       Do we still need this `pat.replace` call?




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