mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-05 22:12:21 +00:00
Add new functional tests for UNION ALL. [#METR-14099]
This commit is contained in:
parent
d29f019981
commit
2d2ccde1c0
@ -0,0 +1,2 @@
|
|||||||
|
1
|
||||||
|
2
|
1
dbms/tests/queries/0_stateless/00098_1_union_all.sql
Normal file
1
dbms/tests/queries/0_stateless/00098_1_union_all.sql
Normal file
@ -0,0 +1 @@
|
|||||||
|
SELECT 1 UNION ALL SELECT 2;
|
@ -0,0 +1,2 @@
|
|||||||
|
1
|
||||||
|
2
|
1
dbms/tests/queries/0_stateless/00098_2_union_all.sql
Normal file
1
dbms/tests/queries/0_stateless/00098_2_union_all.sql
Normal file
@ -0,0 +1 @@
|
|||||||
|
SELECT 1 UNION ALL SELECT 2;
|
@ -0,0 +1,2 @@
|
|||||||
|
1
|
||||||
|
2
|
2
dbms/tests/queries/0_stateless/00098_3_union_all.sql
Normal file
2
dbms/tests/queries/0_stateless/00098_3_union_all.sql
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
SELECT 1 UNION /*comment*/ ALL SELECT 2;
|
||||||
|
|
@ -0,0 +1,3 @@
|
|||||||
|
1 2
|
||||||
|
3 4
|
||||||
|
5 6
|
1
dbms/tests/queries/0_stateless/00098_4_union_all.sql
Normal file
1
dbms/tests/queries/0_stateless/00098_4_union_all.sql
Normal file
@ -0,0 +1 @@
|
|||||||
|
SELECT 1,2 UNION ALL SELECT 3,4 UNION ALL SELECT 5,6;
|
@ -0,0 +1,6 @@
|
|||||||
|
Alice 1000
|
||||||
|
Alice 2000
|
||||||
|
Bob 2000
|
||||||
|
Bob 2000
|
||||||
|
Carol 5000
|
||||||
|
Dennis 35000
|
15
dbms/tests/queries/0_stateless/00098_5_union_all.sql
Normal file
15
dbms/tests/queries/0_stateless/00098_5_union_all.sql
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
DROP TABLE IF EXISTS data2013;
|
||||||
|
DROP TABLE IF EXISTS data2014;
|
||||||
|
|
||||||
|
CREATE TABLE data2013 (name String, value UInt32) ENGINE = Memory;
|
||||||
|
CREATE TABLE data2014 (name String, value UInt32) ENGINE = Memory;
|
||||||
|
|
||||||
|
INSERT INTO data2013(name,value) VALUES('Alice', 1000);
|
||||||
|
INSERT INTO data2013(name,value) VALUES('Bob', 2000);
|
||||||
|
INSERT INTO data2013(name,value) VALUES('Carol', 5000);
|
||||||
|
|
||||||
|
INSERT INTO data2014(name,value) VALUES('Alice', 2000);
|
||||||
|
INSERT INTO data2014(name,value) VALUES('Bob', 2000);
|
||||||
|
INSERT INTO data2014(name,value) VALUES('Dennis', 35000);
|
||||||
|
|
||||||
|
SELECT nn,vv FROM (SELECT name AS nn, value AS vv FROM data2013 UNION ALL SELECT name AS nn, value AS vv FROM data2014) ORDER BY nn ASC;
|
@ -0,0 +1,3 @@
|
|||||||
|
1
|
||||||
|
2
|
||||||
|
3
|
2
dbms/tests/queries/0_stateless/00098_6_union_all.sql
Normal file
2
dbms/tests/queries/0_stateless/00098_6_union_all.sql
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
SELECT X FROM (SELECT 3 AS X UNION ALL SELECT 2 AS X UNION ALL SELECT 1 AS X) ORDER BY X ASC;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user