Merge pull request #61602 from ClickHouse/fix-01244_optimize_distributed_group_by_sharding_key

Fix 01244_optimize_distributed_group_by_sharding_key by ordering output
This commit is contained in:
Mikhail f. Shiryaev 2024-03-20 10:41:05 +01:00 committed by GitHub
commit b8867d74d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -60,9 +60,9 @@ LIMIT OFFSET
OFFSET distributed_push_down_limit=0
1 1
OFFSET distributed_push_down_limit=1
1 1
1 0
1 1
1 1
WHERE LIMIT OFFSET
1 1
LIMIT BY 1

View File

@ -69,7 +69,7 @@ select count(), * from dist_01247 group by number limit 1 offset 1;
select 'OFFSET distributed_push_down_limit=0';
select count(), * from dist_01247 group by number offset 1 settings distributed_push_down_limit=0;
select 'OFFSET distributed_push_down_limit=1';
select count(), * from dist_01247 group by number offset 1 settings distributed_push_down_limit=1;
select count(), * from dist_01247 group by number order by count(), number offset 1 settings distributed_push_down_limit=1;
-- this will emulate different data on for different shards
select 'WHERE LIMIT OFFSET';
select count(), * from dist_01247 where number = _shard_num-1 group by number order by number limit 1 offset 1;