hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zoltan Haindrich (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-13625) Hive Prepared Statement when executed with escape characters in parameter fails
Date Sat, 30 Apr 2016 06:34:12 GMT

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

Zoltan Haindrich commented on HIVE-13625:
-----------------------------------------

hi,
i will write a test ; and i suspect there is another issue here...


> Hive Prepared Statement when executed with escape characters in parameter fails
> -------------------------------------------------------------------------------
>
>                 Key: HIVE-13625
>                 URL: https://issues.apache.org/jira/browse/HIVE-13625
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Daya Venkatesan
>            Assignee: Zoltan Haindrich
>
> When setting parameters to a Hive Prepared Statement, if the parameter  has an odd number
of escape characters, then the Statement fails.
> For example, I set one of the parameters to "/somepath/\044{yyyy}/\044{MM}/\044{dd}/".
Here, I have escaped the dollar character with \044 because Hive gives an Atlas exception
with "$" character. 
> Now, when the parameters are getting set inside Hive, getCharIndexFromSqlByParamLocation
throws an Exception.
> Hive records something called signal count.
>       if (c == '\'' || c == '\\')// record the count of char "'" and char "\"
>       {
>         signalCount++;
>       } 
> And the parameter is set only if the signalCount %2 is 0.
> else if (c == cchar && signalCount % 2 == 0) {// check if the ? is really the
parameter
>         num++;
>         if (num == paramLoc) {
>           charIndex = i;
>           break;
>         }
> Since my parameter has three "\" characters, the signal Count modulo is not 0 and the
parameter is not set at all throwing an exception.



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

Mime
View raw message