hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harish Butani (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-6950) Parsing Error in GROUPING SETS
Date Tue, 22 Apr 2014 20:24:15 GMT

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

Harish Butani commented on HIVE-6950:
-------------------------------------

Yes there s an ambiguity in the grammar. 
The dfa for the groupingSetExpression chooses to interpret the '((tab1.a, tab1.b))' as 
'((tab1.a), (tab1.b))' and so it complains that the ')' is missing.

In the case of '((a, tab1.b))' the dfa chooses the right path.

The fix is to add Syntactic predicate for this rule.

> Parsing Error in GROUPING SETS
> ------------------------------
>
>                 Key: HIVE-6950
>                 URL: https://issues.apache.org/jira/browse/HIVE-6950
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Rohit Agarwal
>
> The following query:
> {code}
> SELECT tab1.a,
>        tab1.b,
>        SUM(tab1.c)
> FROM tab1
> GROUP BY tab1.a,
>          tab1.b
> GROUPING SETS ((tab1.a, tab1.b))
> {code}
> results in the following error:
> {code}
> ParseException line 7:22 missing ) at ',' near '<EOF>'
> line 7:31 extraneous input ')' expecting EOF near '<EOF>'
> {code}
> Changing the query to:
> {code}
> SELECT tab1.a,
>        tab1.b,
>        SUM(tab1.c)
> FROM tab1
> GROUP BY tab1.a,
>          tab1.b
> GROUPING SETS ((a, tab1.b))
> {code}
> makes it work.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message