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

Csaba Ringhofer updated IMPALA-9080:
------------------------------------
    Description: 
Most tests ignore the order of the expected / returned results, but in some 
cases we expect them to be in the same order (decided by
https://github.com/apache/impala/blob/e05a5323785ecb09e45bdb5dfc96533e68256175/tests/common/test_result_verifier.py#L463
 )

The logic above simply checks for the presence of ORDER BY in the query,  while 
the results should be in a deterministic order only if there is an ORDER BY in 
the outermost query.
The following query caused a test failure while the rows returned were correct, 
just in different order:
{code}
select leftSide.id, rnk
from complextypestbl leftSide
left outer join (
    select t.id, rank() over (order by t.id) as rnk
    from complextypestbl t left outer join t.int_array
) rightSide
on leftSide.id = rightSide.id;
{code}

The ORDER BY is in an analytical function, which sorts the results, but those 
results are joined with a table, and the order of  rows returned by JOIN can be 
non-deterministic.

  was:
Most tests ignore the order of the expected / returned results, but in some 
cases we expect them to be in the same order (decided by
https://github.com/apache/impala/blob/e05a5323785ecb09e45bdb5dfc96533e68256175/tests/common/test_result_verifier.py#L463
 )

The logic above simply checks for the presence of ORDER BY in the query,  while 
the results should be in a deterministic order only if there is an ORDER BY in 
the outermost query.
The following query caused test a failure while the rows returned were correct, 
just in different order:
{code}
select leftSide.id, rnk
from complextypestbl leftSide
left outer join (
    select t.id, rank() over (order by t.id) as rnk
    from complextypestbl t left outer join t.int_array
) rightSide
on leftSide.id = rightSide.id;
{code}

The ORDER BY is in an analytical function, which sorts the results, but those 
results are joined with a table, and the order of  rows returned by JOIN can be 
non-deterministic.


> RESULTS section in .test files can unnecessarily check order
> ------------------------------------------------------------
>
>                 Key: IMPALA-9080
>                 URL: https://issues.apache.org/jira/browse/IMPALA-9080
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Infrastructure
>            Reporter: Csaba Ringhofer
>            Priority: Major
>              Labels: flaky-test
>
> Most tests ignore the order of the expected / returned results, but in some 
> cases we expect them to be in the same order (decided by
> https://github.com/apache/impala/blob/e05a5323785ecb09e45bdb5dfc96533e68256175/tests/common/test_result_verifier.py#L463
>  )
> The logic above simply checks for the presence of ORDER BY in the query,  
> while the results should be in a deterministic order only if there is an 
> ORDER BY in the outermost query.
> The following query caused a test failure while the rows returned were 
> correct, just in different order:
> {code}
> select leftSide.id, rnk
> from complextypestbl leftSide
> left outer join (
>     select t.id, rank() over (order by t.id) as rnk
>     from complextypestbl t left outer join t.int_array
> ) rightSide
> on leftSide.id = rightSide.id;
> {code}
> The ORDER BY is in an analytical function, which sorts the results, but those 
> results are joined with a table, and the order of  rows returned by JOIN can 
> be non-deterministic.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to