[
https://issues.apache.org/jira/browse/HIVE-17617?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Zoltan Haindrich updated HIVE-17617:
------------------------------------
Attachment: HIVE-17617.02.patch
#2) forgot to add new test to the props to run with llaplocal
this patch doesn't work with "real" empty tables - it currently only works
correctly for cases when the groupby's input ends up empty; because the
emittion of the {{total rows: NULL}} is at the Map side currently - for a real
empty table the entire Map operator tree is removed; because there are no input
files to it.
It would be possible to move the empty row emittion logic to the reducer side
(which already works for {{select count() from t}} when the table is empty) but
that would need a bit larger scale change - because for the reduce side
{{groupbydesc}} the relevant information is not yet available.
[~jcamachorodriguez],[~ashutoshc] do you have any suggestion how to proceed?
> Rollup of an empty resultset should contain the grouping of the empty
> grouping set
> ----------------------------------------------------------------------------------
>
> Key: HIVE-17617
> URL: https://issues.apache.org/jira/browse/HIVE-17617
> Project: Hive
> Issue Type: Sub-task
> Components: SQL
> Reporter: Zoltan Haindrich
> Assignee: Zoltan Haindrich
> Attachments: HIVE-17617.01.patch, HIVE-17617.02.patch
>
>
> running
> {code}
> drop table if exists tx1;
> create table tx1 (a integer,b integer,c integer);
> select sum(c),
> grouping(b)
> from tx1
> group by rollup (b);
> {code}
> returns 0 rows; however
> according to the standard:
> The <empty grouping set> is regarded as the shortest such initial sublist.
> For example, “ROLLUP ( (A, B), (C, D) )”
> is equivalent to “GROUPING SETS ( (A, B, C, D), (A, B), () )”.
> so I think the totals row (the grouping for {{()}} should be present) - psql
> returns it.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)