aboutsummaryrefslogtreecommitdiff
path: root/sql/core/src/test/resources/sql-tests/results/union.sql.out
blob: d123b7fdbe0cf27f52357ee1456fd75b74c0d824 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
-- Automatically generated by SQLQueryTestSuite
-- Number of queries: 14


-- !query 0
CREATE OR REPLACE TEMPORARY VIEW t1 AS VALUES (1, 'a'), (2, 'b') tbl(c1, c2)
-- !query 0 schema
struct<>
-- !query 0 output



-- !query 1
CREATE OR REPLACE TEMPORARY VIEW t2 AS VALUES (1.0, 1), (2.0, 4) tbl(c1, c2)
-- !query 1 schema
struct<>
-- !query 1 output



-- !query 2
SELECT *
FROM   (SELECT * FROM t1
        UNION ALL
        SELECT * FROM t1)
-- !query 2 schema
struct<c1:int,c2:string>
-- !query 2 output
1	a
1	a
2	b
2	b


-- !query 3
SELECT *
FROM   (SELECT * FROM t1
        UNION ALL
        SELECT * FROM t2
        UNION ALL
        SELECT * FROM t2)
-- !query 3 schema
struct<c1:decimal(11,1),c2:string>
-- !query 3 output
1	1
1	1
1	a
2	4
2	4
2	b


-- !query 4
SELECT a
FROM (SELECT 0 a, 0 b
      UNION ALL
      SELECT SUM(1) a, CAST(0 AS BIGINT) b
      UNION ALL SELECT 0 a, 0 b) T
-- !query 4 schema
struct<a:bigint>
-- !query 4 output
0
0
1


-- !query 5
CREATE OR REPLACE TEMPORARY VIEW p1 AS VALUES 1 T(col)
-- !query 5 schema
struct<>
-- !query 5 output



-- !query 6
CREATE OR REPLACE TEMPORARY VIEW p2 AS VALUES 1 T(col)
-- !query 6 schema
struct<>
-- !query 6 output



-- !query 7
CREATE OR REPLACE TEMPORARY VIEW p3 AS VALUES 1 T(col)
-- !query 7 schema
struct<>
-- !query 7 output



-- !query 8
SELECT 1 AS x,
       col
FROM   (SELECT col AS col
        FROM (SELECT p1.col AS col
              FROM   p1 CROSS JOIN p2
              UNION ALL
              SELECT col
              FROM p3) T1) T2
-- !query 8 schema
struct<x:int,col:int>
-- !query 8 output
1	1
1	1


-- !query 9
DROP VIEW IF EXISTS t1
-- !query 9 schema
struct<>
-- !query 9 output



-- !query 10
DROP VIEW IF EXISTS t2
-- !query 10 schema
struct<>
-- !query 10 output



-- !query 11
DROP VIEW IF EXISTS p1
-- !query 11 schema
struct<>
-- !query 11 output



-- !query 12
DROP VIEW IF EXISTS p2
-- !query 12 schema
struct<>
-- !query 12 output



-- !query 13
DROP VIEW IF EXISTS p3
-- !query 13 schema
struct<>
-- !query 13 output