diff --git a/tests/queries/0_stateless/00184_shard_distributed_group_by_no_merge.reference b/tests/queries/0_stateless/00184_shard_distributed_group_by_no_merge.reference index e3dbeb81c7c..453c7fb5af0 100644 --- a/tests/queries/0_stateless/00184_shard_distributed_group_by_no_merge.reference +++ b/tests/queries/0_stateless/00184_shard_distributed_group_by_no_merge.reference @@ -1,6 +1,41 @@ +distributed_group_by_no_merge=1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 +1 1 +distributed_group_by_no_merge=2 +LIMIT +1 1 1 +OFFSET +2 1 1 +ALIAS +0 +0 +ORDER BY +1 +1 +0 +0 +ORDER BY LIMIT +1 +LIMIT BY +0 +1 +LIMIT BY LIMIT +0 +GROUP BY ORDER BY +1 +1 +1 +1 +GROUP BY w/ ALIAS +0 +1 +0 +1 +ORDER BY w/ ALIAS +0 diff --git a/tests/queries/0_stateless/00184_shard_distributed_group_by_no_merge.sql b/tests/queries/0_stateless/00184_shard_distributed_group_by_no_merge.sql index 78f1fb68385..2089c06ea87 100644 --- a/tests/queries/0_stateless/00184_shard_distributed_group_by_no_merge.sql +++ b/tests/queries/0_stateless/00184_shard_distributed_group_by_no_merge.sql @@ -1,2 +1,40 @@ -SELECT count(), uniq(dummy) FROM remote('127.0.0.{2,3}', system.one) SETTINGS distributed_group_by_no_merge = 1; -SELECT count(), uniq(dummy) FROM remote('127.0.0.{2,3,4,5}', system.one) SETTINGS distributed_group_by_no_merge = 1; +SELECT 'distributed_group_by_no_merge=1'; +SELECT count(), uniq(dummy) FROM remote('127.0.0.{2,3}', system.one) SETTINGS distributed_group_by_no_merge=1; +SELECT count(), uniq(dummy) FROM remote('127.0.0.{2,3,4,5}', system.one) SETTINGS distributed_group_by_no_merge=1; +SELECT count(), uniq(dummy) FROM remote('127.0.0.{2,3}', system.one) LIMIT 1 SETTINGS distributed_group_by_no_merge=1; + +SELECT 'distributed_group_by_no_merge=2'; +SET max_distributed_connections=1; +SET max_threads=1; +-- breaks any(_shard_num) +SET optimize_move_functions_out_of_any=0; + +SELECT 'LIMIT'; +SELECT any(_shard_num) shard_num, count(), uniq(dummy) FROM remote('127.0.0.{2,3}', system.one) LIMIT 1 SETTINGS distributed_group_by_no_merge=2; +SELECT 'OFFSET'; +SELECT any(_shard_num) shard_num, count(), uniq(dummy) FROM remote('127.0.0.{2,3}', system.one) LIMIT 1, 1 SETTINGS distributed_group_by_no_merge=2; + +SELECT 'ALIAS'; +SELECT dummy AS d FROM remote('127.0.0.{2,3}', system.one) ORDER BY d SETTINGS distributed_group_by_no_merge=2; + +DROP TABLE IF EXISTS data_00184; +CREATE TABLE data_00184 Engine=Memory() AS SELECT * FROM numbers(2); +SELECT 'ORDER BY'; +SELECT number FROM remote('127.0.0.{2,3}', currentDatabase(), data_00184) ORDER BY number DESC SETTINGS distributed_group_by_no_merge=2; +SELECT 'ORDER BY LIMIT'; +SELECT number FROM remote('127.0.0.{2,3}', currentDatabase(), data_00184) ORDER BY number DESC LIMIT 1 SETTINGS distributed_group_by_no_merge=2; + +SELECT 'LIMIT BY'; +SELECT number FROM remote('127.0.0.{2,3}', currentDatabase(), data_00184) LIMIT 1 BY number SETTINGS distributed_group_by_no_merge=2; +SELECT 'LIMIT BY LIMIT'; +SELECT number FROM remote('127.0.0.{2,3}', currentDatabase(), data_00184) LIMIT 1 BY number LIMIT 1 SETTINGS distributed_group_by_no_merge=2; + +SELECT 'GROUP BY ORDER BY'; +SELECT uniq(number) u FROM remote('127.0.0.{2,3}', currentDatabase(), data_00184) GROUP BY number ORDER BY u DESC SETTINGS distributed_group_by_no_merge=2; + +-- cover possible tricky issues +SELECT 'GROUP BY w/ ALIAS'; +SELECT n FROM remote('127.0.0.{2,3}', currentDatabase(), data_00184) GROUP BY number AS n SETTINGS distributed_group_by_no_merge=2; + +SELECT 'ORDER BY w/ ALIAS'; +SELECT n FROM remote('127.0.0.{2,3}', currentDatabase(), data_00184) ORDER BY number AS n LIMIT 1 SETTINGS distributed_group_by_no_merge=2; diff --git a/tests/queries/0_stateless/arcadia_skip_list.txt b/tests/queries/0_stateless/arcadia_skip_list.txt index 9d9e327f43c..707f91b0c93 100644 --- a/tests/queries/0_stateless/arcadia_skip_list.txt +++ b/tests/queries/0_stateless/arcadia_skip_list.txt @@ -1,6 +1,7 @@ # Add testcase here to skip it in Arcadia CI (Yandex synchronization check) # It is useful for tests with not supported features in Arcadia build 00105_shard_collations +00184_shard_distributed_group_by_no_merge 00436_convert_charset 00490_special_line_separators_and_characters_outside_of_bmp 00506_union_distributed