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

Krisztian Kasa updated HIVE-23101:
----------------------------------
    Description: 
Example:
{code}
Client Execution succeeded but contained differences (error code = 1) after 
executing topnkey_grouping_sets.q 
260c260
< NULL NULL
---
> NULL 1
{code}
 

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:java}
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:java}
5       NULL
5       2
5       1
6       2
6       NULL
7       8
7       NULL
10      NULL
10      11
NULL    1
{code}
{code:java}
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.

  was:
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.



> 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
>
>
> Example:
> {code}
> Client Execution succeeded but contained differences (error code = 1) after 
> executing topnkey_grouping_sets.q 
> 260c260
> < NULL NULL
> ---
> > NULL 1
> {code}
>  
> 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:java}
> 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:java}
> 5     NULL
> 5     2
> 5     1
> 6     2
> 6     NULL
> 7     8
> 7     NULL
> 10    NULL
> 10    11
> NULL  1
> {code}
> {code:java}
> 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)

Reply via email to