You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Krisztian Kasa (Jira)" <ji...@apache.org> on 2020/03/30 08:24:00 UTC

[jira] [Updated] (HIVE-23101) Fix topnkey_grouping_sets

     [ https://issues.apache.org/jira/browse/HIVE-23101?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Krisztian Kasa updated HIVE-23101:
----------------------------------
    Attachment: HIVE-23101.1.patch

> Fix topnkey_grouping_sets
> -------------------------
>
>                 Key: HIVE-23101
>                 URL: https://issues.apache.org/jira/browse/HIVE-23101
>             Project: Hive
>          Issue Type: Sub-task
>            Reporter: Krisztian Kasa
>            Assignee: Krisztian Kasa
>            Priority: Major
>             Fix For: 4.0.0
>
>         Attachments: HIVE-23101.1.patch
>
>
> Test *topnkey_grouping_sets* fails intermittently.
> Queries which project 2 columns but order by only one of them can have more than one good result set:
> {code}
> CREATE TABLE t_test_grouping_sets(
>   a int,
>   b int,
>   c int
> );
> INSERT INTO t_test_grouping_sets VALUES
> (NULL, NULL, NULL),
> (5, 2, 3),
> (10, 11, 12),
> (NULL, NULL, NULL),
> (NULL, NULL, NULL),
> (6, 2, 1),
> (7, 8, 4), (7, 8, 4), (7, 8, 4),
> (5, 1, 2), (5, 1, 2), (5, 1, 2),
> (NULL, NULL, NULL);
> SELECT a, b FROM t_test_grouping_sets GROUP BY GROUPING SETS ((a, b), (a), (b), ()) ORDER BY a LIMIT 10;
> {code}
> {code}
> 5	NULL
> 5	2
> 5	1
> 6	2
> 6	NULL
> 7	8
> 7	NULL
> 10	NULL
> 10	11
> NULL	1
> {code}
> {code}
> 5	NULL
> 5	2
> 5	1
> 6	2
> 6	NULL
> 7	8
> 7	NULL
> 10	NULL
> 10	11
> NULL	NULL
> {code}
> Since we don't order by *b* both result sets are valid.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)