You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Harish Butani (JIRA)" <ji...@apache.org> on 2014/04/22 22:24:15 UTC

[jira] [Commented] (HIVE-6950) Parsing Error in GROUPING SETS

    [ 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)