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

Laszlo Bodor edited comment on HIVE-21293 at 3/6/19 1:29 PM:
-------------------------------------------------------------

[~jcamachorodriguez]: thanks for the suggestion, I tried it with:
{code}
booleanValue
    :
    KW_TRUE^ | KW_FALSE^ | KW_UNKNOWN -> TOK_NULL
    ;
{code}
but I got the original warning. Did I use it in the wrong way? As far as I 
understand, this rewrite rule will still let the grammar fall into booleanValue 
rule on "unknown" keyword. 
One thing that's not clear to me is: what benefit we have by having "unknown" 
as a boolean constant, but not a reserved keyword (although it indeed seems 
more straightforward).


was (Author: abstractdog):
[~jcamachorodriguez]: thanks for the suggestion, I tried it with:
{code}
booleanValue
    :
    KW_TRUE^ | KW_FALSE^ | KW_UNKNOWN -> TOK_NULL
    ;
{code}
but I got the original issue. Did I use it in the wrong way? As far as I 
understand, this rewrite rule will still let the grammar fall into booleanValue 
rule on "unknown" keyword. 
One thing that's not clear to me is: what benefit we have by having "unknown" 
as a boolean constant, but not a reserved keyword (although it indeed seems 
more straightforward).

> Fix ambiguity in grammar warnings at compilation time (II)
> ----------------------------------------------------------
>
>                 Key: HIVE-21293
>                 URL: https://issues.apache.org/jira/browse/HIVE-21293
>             Project: Hive
>          Issue Type: Bug
>          Components: Parser
>    Affects Versions: 4.0.0
>            Reporter: Jesus Camacho Rodriguez
>            Assignee: Laszlo Bodor
>            Priority: Major
>         Attachments: HIVE-21293.01.patch, HIVE-21293.02.patch
>
>
> These are the warnings at compilation time:
> {code}
> warning(200): IdentifiersParser.g:424:5:
> Decision can match input such as "KW_UNKNOWN" using multiple alternatives: 1, 
> 10
> As a result, alternative(s) 10 were disabled for that input
> {code}
> This means that multiple parser rules can match certain query text, possibly 
> leading to unexpected errors at parsing time.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to