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

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

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


> LIKE starting with % and ending with escaped % does not work correctly
> ----------------------------------------------------------------------
>
>                 Key: IMPALA-14731
>                 URL: https://issues.apache.org/jira/browse/IMPALA-14731
>             Project: IMPALA
>          Issue Type: Bug
>            Reporter: Balazs Hevele
>            Assignee: Balazs Hevele
>            Priority: Critical
>              Labels: Correctness
>
> As an example, {noformat}LIKE "%abc\%"{noformat} matches for any string 
> containing "abc\", instead of "abc%" with any prefix.
> A very similar bug was fixed in 
> https://issues.apache.org/jira/browse/IMPALA-2422 which fixes similar cases 
> without the % at the start, e.g. {noformat}LIKE "abc\%"{noformat}.
> Example queries:
> 1.
> {noformat}
> +----------------------+
> | 'abc%' like '%abc\%' |
> +----------------------+
> | false                | (should be true)
> +----------------------+
> {noformat}
> 2.
> {noformat}
> +-----------------------+
> | 'abc\\' like '%abc\%' |
> +-----------------------+
> | true                  | (should be false)
> +-----------------------+
> {noformat}



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