Merge pull request #39772 from ClickHouse/fix_distinct_in_order_test

Fix non-deterministic queries in distinct_in_order test
This commit is contained in:
Alexander Tokmakov 2022-08-01 20:09:31 +03:00 committed by GitHub
commit 3a57634dbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -85,11 +85,11 @@ select distinct 1 as x, 2 as y from distinct_in_order order by x;
1 2
select distinct 1 as x, 2 as y from distinct_in_order order by x, y;
1 2
select distinct a, 1 as x from distinct_in_order order by x;
select a, x from (select distinct a, 1 as x from distinct_in_order order by x) order by a;
0 1
select distinct a, 1 as x, 2 as y from distinct_in_order order by a;
0 1 2
select distinct a, b, 1 as x, 2 as y from distinct_in_order order by a;
select a, b, x, y from(select distinct a, b, 1 as x, 2 as y from distinct_in_order order by a) order by a, b;
0 0 1 2
0 1 1 2
0 2 1 2
@ -97,10 +97,10 @@ select distinct a, b, 1 as x, 2 as y from distinct_in_order order by a;
0 4 1 2
select distinct x, y from (select 1 as x, 2 as y from distinct_in_order order by x) order by y;
1 2
select distinct a, b, x, y from (select a, b, 1 as x, 2 as y from distinct_in_order order by a) order by b;
select distinct a, b, x, y from (select a, b, 1 as x, 2 as y from distinct_in_order order by a) order by a, b;
0 0 1 2
0 1 1 2
0 2 1 2
0 3 1 2
0 4 1 2
-- check that distinct in order has the same result as ordinary distinct
-- check that distinct in order returns the same result as ordinary distinct

View File

@ -48,16 +48,16 @@ select '-- distinct with constants columns';
select distinct 1 as x, 2 as y from distinct_in_order;
select distinct 1 as x, 2 as y from distinct_in_order order by x;
select distinct 1 as x, 2 as y from distinct_in_order order by x, y;
select distinct a, 1 as x from distinct_in_order order by x;
select a, x from (select distinct a, 1 as x from distinct_in_order order by x) order by a;
select distinct a, 1 as x, 2 as y from distinct_in_order order by a;
select distinct a, b, 1 as x, 2 as y from distinct_in_order order by a;
select a, b, x, y from(select distinct a, b, 1 as x, 2 as y from distinct_in_order order by a) order by a, b;
select distinct x, y from (select 1 as x, 2 as y from distinct_in_order order by x) order by y;
select distinct a, b, x, y from (select a, b, 1 as x, 2 as y from distinct_in_order order by a) order by b;
select distinct a, b, x, y from (select a, b, 1 as x, 2 as y from distinct_in_order order by a) order by a, b;
-- { echoOff }
drop table if exists distinct_in_order sync;
select '-- check that distinct in order has the same result as ordinary distinct';
select '-- check that distinct in order returns the same result as ordinary distinct';
drop table if exists distinct_cardinality_low sync;
CREATE TABLE distinct_cardinality_low (low UInt64, medium UInt64, high UInt64) ENGINE MergeTree() ORDER BY (low, medium);
INSERT INTO distinct_cardinality_low SELECT number % 1e1, number % 1e2, number % 1e3 FROM numbers_mt(1e4);