ClickHouse/tests/queries/0_stateless/02768_cse_nested_distributed.sql
Azat Khuzhin 13a1226971 Fix nested distributed SELECT in WITH clause
For the CSE (common scalar expression, form of CTE) form of WITH it will
set max_result_rows to 1, since there should not be more rows, but this
will be applied for the DESC TABLE as well (service distributed query
that required to obtain the structure).

Note, that it is a problem only for nested distributed queries because
getSubqueryContext() from InterpreterSelectQuery.cpp resets those limits
as well, but this does not helps, for the nested DESC since it is
executed on the remote node that has max_result_rows=1.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-06-03 20:22:51 +02:00

6 lines
328 B
SQL

with (select count() > 0 from remote('127.2', system.settings)) as s select s;
-- nested
with (select count() > 0 from remote('127.2', remote('127.2', system.settings))) as s select s;
-- nested via view()
with (select count() > 0 from remote('127.2', view(select count() from remote('127.2', system.settings)))) as s select s;