hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From goun na <gou...@gmail.com>
Subject Re: Grouping sets with table alias causes parse exception
Date Fri, 22 Jan 2016 02:10:46 GMT
I found that it is already well described and fixed at Hive 1.2. Thanks!

Parsing Error in GROUPING SETS
https://issues.apache.org/jira/browse/HIVE-6950


2016-01-18 19:28 GMT+09:00 goun na <gounna@gmail.com>:

> Hi, Users
>
> While converting legacy Oracle SQL to HiveQL using Grouping set, I found
> an interesting parsing error. See the below example, Test-1 shows the
> expected result, but Test-2 causes parting exception. Is it known issue?
>
> Test-1> No table alias
> select a.col_1, a.col_2
> from
> (
> select '1' as col_1,'1' as  col_2
> union all
> select '2' as col_1, '2'as  col_2
> ) a
> group by col_1, col_2 grouping sets (col_2, col_1);
>
> ----------------
> NULL    1
> NULL    2
> 1       NULL
> 2       NULL
>
>
> Test-2>Table alias 'a.' is added at group by clause
> select a.col_1, a.col_2
> from
> (
> select '1' as col_1,'1' as  col_2
> union all
> select '2' as col_1, '2'as  col_2
> ) a
> group by a.col_1, a.col_2 grouping sets ((a.col_1, a.col_2), a.col_1);
>
>
>
> Error: Error while compiling statement: FAILED: ParseException line 1:162
> missing ) at ',' near ')'
> line 1:172 missing EOF at ',' near ')'
>
> -- Error caused from HiveServer2
>
>
>
> *org.apache.hive.service.cli.HiveSQLException:Error while compiling
> statement: FAILED: ParseException line 1:162 missing ) at ',' near ')'
> line 1:172 missing EOF at ',' near ')':28:27
>
> Thanks,
> Goun Na
>

Mime
View raw message