[ 
https://issues.apache.org/jira/browse/IMPALA-10849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18057640#comment-18057640
 ] 

ASF subversion and git services commented on IMPALA-10849:
----------------------------------------------------------

Commit 3be15fd3598071eaeddd9b4d29e0883b95fdd14a in impala's branch 
refs/heads/master from Balazs Hevele
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=3be15fd35 ]

IMPALA-14731: Fix LIKE starting with % ending with escaped %

The escape before the % at the end was not parsed properly as an
escape wildcard.

As an example, "%abc\%" matched for anything containing "abc\"
(containing the backslash character), instead of any any string with
the suffix "abc%".

The fix is basically the same as the one for IMPALA-10849 but for the
case when the pattern starts with %.

New test cases were added to exprs.test.

Change-Id: I6eebfaeffdb59d5d2c1cfbd331fa98d0391325e7
Reviewed-on: http://gerrit.cloudera.org:8080/23953
Reviewed-by: Csaba Ringhofer <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>


> A LIKE predicate that ends in an escaped wildcard is incorrectly evaluated
> --------------------------------------------------------------------------
>
>                 Key: IMPALA-10849
>                 URL: https://issues.apache.org/jira/browse/IMPALA-10849
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Backend
>            Reporter: Andrew Sherman
>            Assignee: Andrew Sherman
>            Priority: Critical
>             Fix For: Impala 4.1.0
>
>
> If the last character of a LIKE predicate is an escaped wildcard (e.g. LIKE 
> foo\%) then it is incorrectly evaluated. This is because the fast path 
> optimizations in LikePrepareInternal treat the predicate as being a search 
> for a string with a fixed prefix. If the fast path optimizations are 
> commented out then the LIKE is evaluated correctly.
> A possible fix would be to make the fast path optimizations recognize that 
> escaped wildcards cannot be evaluated by the fixed prefix search.
> This is a simpler bug than that discussed in IMPALA-2422 which is to do with 
> ambiguities in the logic of unescaping string literals (which is more tricky 
> to fix).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to