You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Miklos Csanady (JIRA)" <ji...@apache.org> on 2016/09/20 14:12:21 UTC

[jira] [Comment Edited] (HIVE-10701) Escape apostrophe not work properly

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

Miklos Csanady edited comment on HIVE-10701 at 9/20/16 2:11 PM:
----------------------------------------------------------------

According to https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types#LanguageManualTypes-string
"Hive uses C-style escaping within the strings."

1: jdbc:hive2://> select 's''2' ;
OK
 +------+
 | _c0  |
 +------+
 | s2   |
 +------+
1 row selected (0.051 seconds)
1: jdbc:hive2://> select 's\'2' ;
OK
 +------+
 | _c0  |
 +------+
 | s'2  |
 +------+

IMHO the '' is not meant to be an escape-sequence, but two string literals.



was (Author: mcsanady):
According to https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types#LanguageManualTypes-string
"Hive uses C-style escaping within the strings."

1: jdbc:hive2://> select 's''2' ;
OK
+------+
| _c0  |
+------+
| s2   |
+------+
1 row selected (0.051 seconds)
1: jdbc:hive2://> select 's\'2' ;
OK
+------+
| _c0  |
+------+
| s'2  |
+------+

IMHO the '' is not meant to be an escape-sequence, but two string literals.


> Escape apostrophe not work properly
> -----------------------------------
>
>                 Key: HIVE-10701
>                 URL: https://issues.apache.org/jira/browse/HIVE-10701
>             Project: Hive
>          Issue Type: Bug
>          Components: Hive
>    Affects Versions: 0.12.0, 0.13.0, 0.14.0
>            Reporter: Tracy Y
>            Assignee: Miklos Csanady
>            Priority: Minor
>
> SELECT  'S''2'  FROM table return S2 instead of S'2
> The apostrophe suppose to be escaped by the single quote in front.  
> Thanks.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)