Balazs Hevele has posted comments on this change. ( http://gerrit.cloudera.org:8080/23932 )
Change subject: IMPALA-12374: Optimize trailing/leading % in LIKE ...................................................................... Patch Set 10: (3 comments) http://gerrit.cloudera.org:8080/#/c/23932/9/be/src/exprs/like-predicate.cc File be/src/exprs/like-predicate.cc: http://gerrit.cloudera.org:8080/#/c/23932/9/be/src/exprs/like-predicate.cc@70 PS9, Line 70: if (context->IsArgConstant(1)) { > We have existing tests for the correctness of LIKE. If we restructured this Done http://gerrit.cloudera.org:8080/#/c/23932/9/be/src/exprs/like-predicate.cc@109 PS9, Line 109: ext->IsArgCons > This should work with case_insensitive=false (i.e. ILIKE) too, unlike the o Done http://gerrit.cloudera.org:8080/#/c/23932/9/be/src/exprs/like-predicate.cc@109 PS9, Line 109: if (context->IsArgConstant(1)) { : StringVal* pattern = reinterpret_cast<StringVal*>(context->GetConstantArg(1)); : if (pattern->is_null) return; : string pattern_str(reinterpret_cast<const char*>(pattern->ptr), pattern->len); : string search_string; : // The following four conditionals check if the pattern is a constant string, : // starts with a constant string and is followed by any number of wildcard characters, : // ends with a constant string and is preceded by any number of wildcard characters or : // has a constant substring surrounded on both sides by any number of wildcard : // characters. In any of these conditions, we can search for the pattern more : // efficiently by using our own string match functions rather than regex matching. : if (case_sensitive && RE2::FullMatch(pattern_str, EQUALS_RE, &search_string)) { : state->SetSearchString(search_string); : state->function_ = ConstantEqualsFn; : } else if (case_sensitive && : RE2::FullMatch(pattern_str, STARTS_WITH_RE, &search_string)) { : state->SetSearchString(search_string); : state->function_ = ConstantStartsWithFn; : } else if (case_sensitive && : > Can we add some test cases in expr-test.cc's LikePredicate() to cover some Done -- To view, visit http://gerrit.cloudera.org:8080/23932 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I37b472e056f791035d25633f17ad8a6e841cdd18 Gerrit-Change-Number: 23932 Gerrit-PatchSet: 10 Gerrit-Owner: Balazs Hevele <[email protected]> Gerrit-Reviewer: Balazs Hevele <[email protected]> Gerrit-Reviewer: Csaba Ringhofer <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Joe McDonnell <[email protected]> Gerrit-Comment-Date: Tue, 17 Feb 2026 09:23:19 +0000 Gerrit-HasComments: Yes
