[ 
https://issues.apache.org/jira/browse/IMPALA-3941?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tim Armstrong resolved IMPALA-3941.
-----------------------------------
    Resolution: Cannot Reproduce

This has since been fixed.

> regexp_replace Can Swallow Odd Quotes
> -------------------------------------
>
>                 Key: IMPALA-3941
>                 URL: https://issues.apache.org/jira/browse/IMPALA-3941
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Backend
>    Affects Versions: Impala 2.6.0
>            Reporter: Alan Jackoway
>            Priority: Minor
>
> We were trying to remove an escape character in front of a single quote using 
> regexp_replace.
> When testing our regexp, we wanted to make sure it wouldn't knock out 
> non-escaped quotes. That led us to this odd case:
> {code:sql}
> Query: select regexp_replace("It's a bad test\'s day", "\\\\'", "'")
> +--------------------------------------------------------+
> | regexp_replace('it's a bad test\'s day', '\\\\'', ''') |
> +--------------------------------------------------------+
> | Its day                                                |
> +--------------------------------------------------------+
> {code}
> That only seems to happen when we mix single quotes with escaped quotes. If 
> all the quotes are escaped it works. Here's a few more interesting cases:
> {code:sql}
> Query: select regexp_replace("It's a bad test's day", "\\\\'", "'")
> +-------------------------------------------------------+
> | regexp_replace('it's a bad test's day', '\\\\'', ''') |
> +-------------------------------------------------------+
> | Its day                                               |
> +-------------------------------------------------------+
> Query: select regexp_replace("It\'s a bad test\'s day", "\\\\'", "'")
> +---------------------------------------------------------+
> | regexp_replace('it\'s a bad test\'s day', '\\\\'', ''') |
> +---------------------------------------------------------+
> | It's a bad test's day                                   |
> +---------------------------------------------------------+
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to