You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Harsh J (JIRA)" <ji...@apache.org> on 2014/10/14 01:45:34 UTC
[jira] [Reopened] (HIVE-7178) Table alias cannot be used in
GROUPING SETS clause if there are more than one column in it
[ https://issues.apache.org/jira/browse/HIVE-7178?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Harsh J reopened HIVE-7178:
---------------------------
> Table alias cannot be used in GROUPING SETS clause if there are more than one column in it
> ------------------------------------------------------------------------------------------
>
> Key: HIVE-7178
> URL: https://issues.apache.org/jira/browse/HIVE-7178
> Project: Hive
> Issue Type: Bug
> Components: SQL
> Affects Versions: 0.13.0
> Reporter: Yibing Shi
>
> The following SQL doesn't work:
> {code}
> EXPLAIN
> SELECT alias.a, alias.b, alias.c, COUNT(DISTINCT d)
> FROM table_name alias
> GROUP BY alias.a, alias.b, alias.c
> GROUPING SETS( (alias.a), (alias.b, alias.a) );
> FAILED: ParseException line 15:34 missing ) at ',' near '<EOF>'
> line 16:0 extraneous input ')' expecting EOF near '<EOF>'
> {code}
> The following SQL works (without alias in grouping set):
> {code}
> EXPLAIN
> SELECT a, b, c, COUNT(DISTINCT d)
> FROM table_name
> GROUP BY a, b, c
> GROUPING SETS( (a), (b, a) );
> {code}
> Alias works for just one column:
> {code}
> EXPLAIN
> SELECT alias.a, alias.b, alias.c, COUNT(DISTINCT d)
> FROM table_name alias
> GROUP BY alias.a, alias.b, alias.c
> GROUPING SETS( (alias.a) );
> {code}
> Using alias in GROUPING SETS could be very useful if multiple tables are involved in the SELECT (via JOIN)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)