ClickHouse/tests/queries/0_stateless/02899_distributed_limit_by.sql.j2
Azat Khuzhin 6da75a47c5 Fix "Cannot find column X in source stream" for Distributed queries with LIMIT BY
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-10-19 18:38:29 +02:00

27 lines
1.0 KiB
Django/Jinja

{#
Randomize settings:
- prefer_localhost_replica
- distributed_group_by_no_merge (0 = WithMergeableState, 1 = Complete, 2 = WithMergeableStateAfterAggregation/WithMergeableStateAfterAggregationAndLimit)
- distributed_push_down_limit (0/1 = dis/allows WithMergeableStateAfterAggregationAndLimit
#}
{% for settings in product(
[
'prefer_localhost_replica=0',
'prefer_localhost_replica=1',
],
[
'distributed_group_by_no_merge=0',
'distributed_group_by_no_merge=1',
'distributed_group_by_no_merge=2',
],
[
'distributed_push_down_limit=1',
'distributed_push_down_limit=0',
],
) %}
{% set settings = settings | join(',') %}
select 'Used settings: {{ settings }}';
select dummy from remote('127.{1,1}', system.one) where dummy + dummy >= 0 limit 1 by dummy + dummy + 0 as l settings {{ settings }};
select dummy from (select dummy + dummy + 0 as l, dummy from remote('127.{1,1}', system.one) where dummy + dummy >= 0 limit 1 by l) settings {{ settings }};
{% endfor %}