Test 03228_pr_subquery_view_order_by

PR + subquery with view and order by
This commit is contained in:
Igor Nikonov 2024-08-23 20:11:33 +00:00
parent 17c1e82bc0
commit d12aac7d12
2 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,20 @@
300
299
298
297
296
295
294
293
292
291
290
289
288
287
286
285
284
283
282
281

View File

@ -0,0 +1,18 @@
DROP TABLE IF EXISTS view1;
DROP TABLE IF EXISTS table1;
CREATE TABLE table1 (number UInt64) ENGINE=MergeTree ORDER BY number SETTINGS index_granularity=1;
INSERT INTO table1 SELECT number FROM numbers(1, 300);
CREATE VIEW view1 AS SELECT number FROM table1;
SELECT *
FROM
(
SELECT *
FROM view1
)
ORDER BY number DESC
LIMIT 20
SETTINGS cluster_for_parallel_replicas = 'parallel_replicas', allow_experimental_parallel_reading_from_replicas = 1, max_parallel_replicas = 3, parallel_replicas_for_non_replicated_merge_tree = 1, parallel_replicas_local_plan = 1, query_plan_lift_up_union = 0;
DROP TABLE view1;
DROP TABLE table1;