> On March 29, 2017, 11:19 p.m., Ashutosh Chauhan wrote:
> > ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
> > Line 3091 (original), 3096 (patched)
> > <https://reviews.apache.org/r/57094/diff/1/?file=1650285#file1650285line3099>
> >
> > This should be 1
>
> Jesús Camacho Rodríguez wrote:
> I am not sure about that... My understanding was that if there are no
> grouping sets in the query, value should always be 0 (I think we discussed
> this previously, but I do not recall for sure).
>
> Ashutosh Chauhan wrote:
> Can you test this on postgres? I think I tested this previously and found
> that this should be 0.
I have checked in Postgres and it is correct as it is (0 if there are no
grouping sets).
jcamachorodriguez=# create table T1(key INT, value INT);
CREATE TABLE
jcamachorodriguez=# insert into T1 values (2, 3);
INSERT 0 1
jcamachorodriguez=# select key, value, grouping(key, value) from T1 group by
key, value;
key | value | grouping
-----+-------+----------
2 | 3 | 0
(1 row)
jcamachorodriguez=# select key, value, grouping(key, value) from T1 group by
rollup(key, value);
key | value | grouping
-----+-------+----------
2 | 3 | 0
2 | | 1
| | 3
(3 rows)
jcamachorodriguez=#
- Jesús
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/57094/#review170498
-----------------------------------------------------------
On April 3, 2017, 8:09 a.m., Jesús Camacho Rodríguez wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/57094/
> -----------------------------------------------------------
>
> (Updated April 3, 2017, 8:09 a.m.)
>
>
> Review request for hive and Ashutosh Chauhan.
>
>
> Bugs: HIVE-15996
> https://issues.apache.org/jira/browse/HIVE-15996
>
>
> Repository: hive-git
>
>
> Description
> -------
>
> HIVE-15996
>
>
> Diffs
> -----
>
> ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
> f2a6ade1ae15afa8887cef885f308202c44b404d
> ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFGrouping.java
> cc015268de0ab1e32401c1cf7c21502fb2a45331
> ql/src/test/queries/clientpositive/groupby_grouping_sets_grouping.q
> 34759cab03f865a833ff0ecc8daae500edcadaa4
> ql/src/test/queries/clientpositive/vector_groupby_grouping_sets_grouping.q
> 7b7c8927d9008a44e380f752fb9713892f7f9630
> ql/src/test/results/clientpositive/groupby_grouping_sets_grouping.q.out
> b82d9c273bb9d1a70c6b88bf3cb2033d1a2978f9
>
> ql/src/test/results/clientpositive/llap/vector_groupby_grouping_sets_grouping.q.out
> 8696207c6c24516e7c65cb1340bf774a97bac2d0
>
>
> Diff: https://reviews.apache.org/r/57094/diff/3/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Jesús Camacho Rodríguez
>
>