edponce commented on a change in pull request #11296:
URL: https://github.com/apache/arrow/pull/11296#discussion_r720695894



##########
File path: cpp/src/arrow/compute/kernels/scalar_string.cc
##########
@@ -1084,34 +1084,38 @@ struct MatchLike {
 
     Status status;
     std::string pattern;
-    if (!original_options.ignore_case &&
-        re2::RE2::FullMatch(original_options.pattern, 
kLikePatternIsSubstringMatch,
-                            &pattern)) {
-      MatchSubstringOptions converted_options{pattern, 
original_options.ignore_case};
-      MatchSubstringState converted_state(converted_options);
-      ctx->SetState(&converted_state);
-      status = MatchSubstring<StringType, PlainSubstringMatcher>::Exec(ctx, 
batch, out);
-    } else if (!original_options.ignore_case &&
-               re2::RE2::FullMatch(original_options.pattern, 
kLikePatternIsStartsWith,
-                                   &pattern)) {
-      MatchSubstringOptions converted_options{pattern, 
original_options.ignore_case};
-      MatchSubstringState converted_state(converted_options);
-      ctx->SetState(&converted_state);
-      status = MatchSubstring<StringType, PlainStartsWithMatcher>::Exec(ctx, 
batch, out);
-    } else if (!original_options.ignore_case &&
-               re2::RE2::FullMatch(original_options.pattern, 
kLikePatternIsEndsWith,
-                                   &pattern)) {
-      MatchSubstringOptions converted_options{pattern, 
original_options.ignore_case};
-      MatchSubstringState converted_state(converted_options);
-      ctx->SetState(&converted_state);
-      status = MatchSubstring<StringType, PlainEndsWithMatcher>::Exec(ctx, 
batch, out);
-    } else {
+    bool matched = false;
+    if (!original_options.ignore_case) {
+      if ((matched = re2::RE2::FullMatch(original_options.pattern,
+                                         kLikePatternIsSubstringMatch, 
&pattern))) {
+        MatchSubstringOptions converted_options{pattern, 
original_options.ignore_case};
+        MatchSubstringState converted_state(converted_options);
+        ctx->SetState(&converted_state);
+        status = MatchSubstring<StringType, PlainSubstringMatcher>::Exec(ctx, 
batch, out);
+      } else if ((matched = re2::RE2::FullMatch(original_options.pattern,
+                                                kLikePatternIsStartsWith, 
&pattern))) {
+        MatchSubstringOptions converted_options{pattern, 
original_options.ignore_case};
+        MatchSubstringState converted_state(converted_options);
+        ctx->SetState(&converted_state);
+        status =
+            MatchSubstring<StringType, PlainStartsWithMatcher>::Exec(ctx, 
batch, out);
+      } else if ((matched = re2::RE2::FullMatch(original_options.pattern,
+                                                kLikePatternIsEndsWith, 
&pattern))) {
+        MatchSubstringOptions converted_options{pattern, 
original_options.ignore_case};
+        MatchSubstringState converted_state(converted_options);
+        ctx->SetState(&converted_state);
+        status = MatchSubstring<StringType, PlainEndsWithMatcher>::Exec(ctx, 
batch, out);
+      }
+    }
+#ifdef ARROW_WITH_RE2

Review comment:
       Yes, it was fixed. It was my mistake that I was working in an older 
branch.
   Thanks for noticing this! I will close PR and issue.




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