Yibing Shi created HIVE-7178:
--------------------------------
Summary: 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:
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>'
The following SQL works (without alias in grouping set):
EXPLAIN
SELECT a, b, c, COUNT(DISTINCT d)
FROM table_name
GROUP BY a, b, c
GROUPING SETS( (a), (b, a) );
Alias works for just one column:
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) );
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.2#6252)