mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-03 13:02:00 +00:00
Update functional tests. Add materialization in UNION ALL queries. [#METR-14099]
This commit is contained in:
parent
2d2ccde1c0
commit
44ebf0777c
@ -1,2 +1,2 @@
|
||||
1
|
||||
2
|
||||
1000
|
||||
2000
|
||||
|
@ -1 +1,20 @@
|
||||
SELECT 1 UNION ALL SELECT 2;
|
||||
DROP TABLE IF EXISTS data2013;
|
||||
DROP TABLE IF EXISTS data2014;
|
||||
|
||||
CREATE TABLE data2013 (name String, value UInt32) ENGINE = TinyLog;
|
||||
CREATE TABLE data2014 (name String, value UInt32) ENGINE = TinyLog;
|
||||
|
||||
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 val FROM
|
||||
(SELECT value AS val FROM data2013 WHERE name = 'Alice'
|
||||
UNION ALL
|
||||
SELECT value AS val FROM data2014 WHERE name = 'Alice')
|
||||
ORDER BY val ASC;
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
1
|
||||
2
|
||||
1000
|
||||
2000
|
||||
|
@ -1 +1,6 @@
|
||||
SELECT 1 UNION ALL SELECT 2;
|
||||
SELECT val FROM
|
||||
(SELECT value AS val FROM data2013 WHERE name = 'Alice'
|
||||
UNION ALL
|
||||
SELECT value AS val FROM data2014 WHERE name = 'Alice')
|
||||
ORDER BY val ASC;
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
1
|
||||
2
|
||||
1000
|
||||
2000
|
||||
|
@ -1,2 +1,6 @@
|
||||
SELECT 1 UNION /*comment*/ ALL SELECT 2;
|
||||
SELECT val FROM
|
||||
(SELECT value AS val FROM data2013 WHERE name = 'Alice'
|
||||
UNION /*comment*/ ALL
|
||||
SELECT value AS val FROM data2014 WHERE name = 'Alice')
|
||||
ORDER BY val ASC;
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
1 2
|
||||
3 4
|
||||
5 6
|
||||
1000
|
||||
2000
|
||||
35000
|
||||
|
@ -1 +1,7 @@
|
||||
SELECT 1,2 UNION ALL SELECT 3,4 UNION ALL SELECT 5,6;
|
||||
SELECT val FROM
|
||||
(SELECT value AS val FROM data2013 WHERE name = 'Alice'
|
||||
UNION ALL
|
||||
SELECT value AS val FROM data2014 WHERE name = 'Alice'
|
||||
UNION ALL
|
||||
SELECT value AS val FROM data2014 WHERE name = 'Dennis')
|
||||
ORDER BY val ASC;
|
||||
|
@ -1,15 +1 @@
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user