aboutsummaryrefslogtreecommitdiff
path: root/sql/core/src/test/resources/sql-tests/results/cross-join.sql.out
blob: 562e174fc0bb26b0de4e845c5ed65591192823fb (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
-- Automatically generated by SQLQueryTestSuite
-- Number of queries: 12


-- !query 0
create temporary view nt1 as select * from values
  ("one", 1),
  ("two", 2),
  ("three", 3)
  as nt1(k, v1)
-- !query 0 schema
struct<>
-- !query 0 output



-- !query 1
create temporary view nt2 as select * from values
  ("one", 1),
  ("two", 22),
  ("one", 5)
  as nt2(k, v2)
-- !query 1 schema
struct<>
-- !query 1 output



-- !query 2
SELECT * FROM nt1 cross join nt2
-- !query 2 schema
struct<k:string,v1:int,k:string,v2:int>
-- !query 2 output
one	1	one	1
one	1	one	5
one	1	two	22
three	3	one	1
three	3	one	5
three	3	two	22
two	2	one	1
two	2	one	5
two	2	two	22


-- !query 3
SELECT * FROM nt1 cross join nt2 where nt1.k = nt2.k
-- !query 3 schema
struct<k:string,v1:int,k:string,v2:int>
-- !query 3 output
one	1	one	1
one	1	one	5
two	2	two	22


-- !query 4
SELECT * FROM nt1 cross join nt2 on (nt1.k = nt2.k)
-- !query 4 schema
struct<k:string,v1:int,k:string,v2:int>
-- !query 4 output
one	1	one	1
one	1	one	5
two	2	two	22


-- !query 5
SELECT * FROM nt1 cross join nt2 where nt1.v1 = 1 and nt2.v2 = 22
-- !query 5 schema
struct<k:string,v1:int,k:string,v2:int>
-- !query 5 output
one	1	two	22


-- !query 6
SELECT a.key, b.key FROM
(SELECT k key FROM nt1 WHERE v1 < 2) a
CROSS JOIN
(SELECT k key FROM nt2 WHERE v2 = 22) b
-- !query 6 schema
struct<key:string,key:string>
-- !query 6 output
one	two


-- !query 7
create temporary view A(a, va) as select * from nt1
-- !query 7 schema
struct<>
-- !query 7 output



-- !query 8
create temporary view B(b, vb) as select * from nt1
-- !query 8 schema
struct<>
-- !query 8 output



-- !query 9
create temporary view C(c, vc) as select * from nt1
-- !query 9 schema
struct<>
-- !query 9 output



-- !query 10
create temporary view D(d, vd) as select * from nt1
-- !query 10 schema
struct<>
-- !query 10 output



-- !query 11
select * from ((A join B on (a = b)) cross join C) join D on (a = d)
-- !query 11 schema
struct<a:string,va:int,b:string,vb:int,c:string,vc:int,d:string,vd:int>
-- !query 11 output
one	1	one	1	one	1	one	1
one	1	one	1	three	3	one	1
one	1	one	1	two	2	one	1
three	3	three	3	one	1	three	3
three	3	three	3	three	3	three	3
three	3	three	3	two	2	three	3
two	2	two	2	one	1	two	2
two	2	two	2	three	3	two	2
two	2	two	2	two	2	two	2