Impala Public Jenkins has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/17798 )
Change subject: IMPALA-10849: Ignore escaped wildcards that terminate like predicates. ...................................................................... IMPALA-10849: Ignore escaped wildcards that terminate like predicates. A like predicate is generally evaluated by converting it into a regex that is evaluated at execution time. If the predicate of a like clause is a constant (which is the common case when you say "row like 'start%'") then there are optimizations where some cases that are simpler then a regex are spotted, and a simple function than a regex evaluator is used. One example is that a predicate such as ‘start%’ is evaluated by looking for strings that begin with "start". Amusingly the code that spots the potential optimizations uses regexes to look for patterns in the like predicate. The code that looks for the optimization where a simple prefix can be searched for does not deal with the case where the '%' wildcard at the end of the predicate is escaped. To fix this we add a test that deals with the case where the predicate ends in an escaped '%'. There are some other problems with escaped wildcards discussed in IMPALA-2422. This change does not fix these problems, which are hard. New tests for escaped wildcards are added to exprs.test - note that these tests cannot be part of the LikeTbl tests as the like predicate optimizations are only applied when the like predicate is a string literal. Exhaustive tests ran clean. Change-Id: I30356c19f4f169d99f7cc6268937653af6b41b70 Reviewed-on: http://gerrit.cloudera.org:8080/17798 Reviewed-by: Impala Public Jenkins <[email protected]> Tested-by: Impala Public Jenkins <[email protected]> --- M be/src/exprs/like-predicate.cc M testdata/workloads/functional-query/queries/QueryTest/exprs.test 2 files changed, 63 insertions(+), 1 deletion(-) Approvals: Impala Public Jenkins: Looks good to me, approved; Verified -- To view, visit http://gerrit.cloudera.org:8080/17798 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I30356c19f4f169d99f7cc6268937653af6b41b70 Gerrit-Change-Number: 17798 Gerrit-PatchSet: 3 Gerrit-Owner: Andrew Sherman <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Wenzhe Zhou <[email protected]>
