mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Make the query planner respect LIMIT BY in remote queries
This commit is contained in:
parent
c39c32973c
commit
df6860d5e0
@ -623,6 +623,12 @@ void InterpreterSelectQuery::executeImpl(Pipeline & pipeline, const BlockInputSt
|
||||
if (expressions.has_order_by && query.limit_length)
|
||||
executeDistinct(pipeline, false, expressions.selected_columns);
|
||||
|
||||
if (expressions.has_limit_by)
|
||||
{
|
||||
executeExpression(pipeline, expressions.before_limit_by);
|
||||
executeLimitBy(pipeline);
|
||||
}
|
||||
|
||||
if (query.limit_length)
|
||||
executePreLimit(pipeline);
|
||||
}
|
||||
|
@ -19,3 +19,8 @@
|
||||
0
|
||||
0
|
||||
1
|
||||
100
|
||||
100
|
||||
101
|
||||
101
|
||||
102
|
||||
|
@ -29,4 +29,7 @@ SELECT dummy FROM remote('127.0.0.{2,3}', system.one) LIMIT 2 BY dummy;
|
||||
|
||||
SELECT 1 as one FROM remote('127.0.0.{2,3}', system.one) LIMIT 1 BY one;
|
||||
|
||||
-- Distributed LIMIT BY with LIMIT
|
||||
SELECT toInt8(number / 5 + 100) AS x FROM remote('127.0.0.1', system.numbers) LIMIT 2 BY x LIMIT 5;
|
||||
|
||||
DROP TABLE IF EXISTS test.limit_by;
|
||||
|
Loading…
Reference in New Issue
Block a user