Skip to content

Commit 389d885

Browse files
authored
Merge pull request #9354 from xudong963/enable_ydb
feat: try to enable more tests for cluster
2 parents 5701b4e + 33d24f7 commit 389d885

File tree

6 files changed

+208
-185
lines changed

6 files changed

+208
-185
lines changed

Diff for: .github/workflows/dev-linux.yml

+3
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ jobs:
157157
- "base"
158158
- "query"
159159
- "cluster"
160+
- "ydb"
161+
- "duckdb"
162+
- "crdb"
160163
handlers:
161164
- "mysql"
162165
- "http"

Diff for: tests/sqllogictests/suites/crdb/join

100644100755
+36-166
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
control sortmode rowsort
2+
13
statement ok
24
drop table if exists onecolumn
35

@@ -10,15 +12,15 @@ INSERT INTO onecolumn(x) VALUES (44), (NULL), (42)
1012
query II
1113
SELECT * FROM onecolumn AS a(x) CROSS JOIN onecolumn AS b(y) order by x
1214
----
15+
42 42
1316
42 44
1417
42 NULL
15-
42 42
18+
44 42
1619
44 44
1720
44 NULL
18-
44 42
21+
NULL 42
1922
NULL 44
2023
NULL NULL
21-
NULL 42
2224

2325
statement error 1065
2426
SELECT x FROM onecolumn AS a, onecolumn AS b
@@ -58,15 +60,15 @@ NULL
5860
query II
5961
SELECT * FROM onecolumn AS a, onecolumn AS b ORDER BY x
6062
----
63+
42 42
6164
42 44
6265
42 NULL
63-
42 42
66+
44 42
6467
44 44
6568
44 NULL
66-
44 42
69+
NULL 42
6770
NULL 44
6871
NULL NULL
69-
NULL 42
7072

7173
query I
7274
SELECT * FROM onecolumn AS a NATURAL LEFT OUTER JOIN onecolumn AS b order by a.x
@@ -108,12 +110,12 @@ INSERT INTO onecolumn_w(w) VALUES (42),(43)
108110
query II
109111
SELECT * FROM onecolumn AS a NATURAL JOIN onecolumn_w as b
110112
----
113+
42 42
114+
42 43
111115
44 42
112116
44 43
113117
NULL 42
114118
NULL 43
115-
42 42
116-
42 43
117119

118120
statement ok
119121
drop table if exists othercolumn
@@ -134,45 +136,45 @@ NULL 43
134136
NULL NULL
135137

136138
query II
137-
SELECT * FROM onecolumn AS a full OUTER JOIN othercolumn AS b ON a.x = b.x and a.x > 16 order by b.x
139+
SELECT * FROM onecolumn AS a full OUTER JOIN othercolumn AS b ON a.x = b.x and a.x > 16 order by a.x
138140
----
139-
NULL 16
140141
42 42
141-
NULL 43
142142
44 NULL
143+
NULL 16
144+
NULL 43
143145
NULL NULL
144146

145147
query II
146148
SELECT * FROM onecolumn AS a full OUTER JOIN othercolumn AS b ON a.x = b.x and b.x > 16 order by b.x
147149
----
148-
NULL 16
149150
42 42
150-
NULL 43
151151
44 NULL
152+
NULL 16
153+
NULL 43
152154
NULL NULL
153155

154156
query II
155157
SELECT * FROM onecolumn AS a full OUTER JOIN othercolumn AS b ON false order by b.x
156158
----
159+
42 NULL
160+
44 NULL
157161
NULL 16
158162
NULL 42
159163
NULL 43
160-
44 NULL
161164
NULL NULL
162-
42 NULL
163165

164166
query II
165167
SELECT * FROM onecolumn AS a full OUTER JOIN othercolumn AS b ON true order by b.x
166168
----
167-
44 16
168-
NULL 16
169169
42 16
170-
44 42
171-
NULL 42
172170
42 42
171+
42 43
172+
44 16
173+
44 42
173174
44 43
175+
NULL 16
176+
NULL 42
174177
NULL 43
175-
42 43
176178

177179
## query
178180
## SELECT * FROM onecolumn AS a FULL OUTER JOIN othercolumn AS b USING(x) ORDER BY x
@@ -279,16 +281,16 @@ INSERT INTO twocolumn(x, y) VALUES (44,51), (NULL,52), (42,53), (45,45)
279281
query II
280282
SELECT * FROM onecolumn NATURAL JOIN twocolumn
281283
----
282-
44 51
283284
42 53
285+
44 51
284286

285287
query IIII
286288
SELECT * FROM twocolumn AS a JOIN twocolumn AS b ON a.x = a.y order by a.x
287289
----
288-
45 45 44 51
289-
45 45 NULL 52
290290
45 45 42 53
291+
45 45 44 51
291292
45 45 45 45
293+
45 45 NULL 52
292294

293295
query II
294296
SELECT o.x, t.y FROM onecolumn o INNER JOIN twocolumn t ON (o.x=t.x AND t.y=53)
@@ -353,17 +355,17 @@ SELECT * FROM a LEFT OUTER JOIN b ON a.i = b.i
353355
query III
354356
SELECT * FROM a RIGHT OUTER JOIN b ON a.i = b.i order by b
355357
----
356-
NULL 4 0
357358
2 2 1
358359
3 3 1
360+
NULL 4 0
359361

360362
query III
361363
SELECT * FROM a FULL OUTER JOIN b ON a.i = b.i order by b
362364
----
363-
NULL 4 0
365+
1 NULL NULL
364366
2 2 1
365367
3 3 1
366-
1 NULL NULL
368+
NULL 4 0
367369

368370
query III
369371
SELECT * FROM a FULL OUTER JOIN b ON (a.i = b.i and a.i>2) ORDER BY a.i, b.i
@@ -389,11 +391,11 @@ NULL 4 0
389391
query III
390392
SELECT * FROM a FULL OUTER JOIN b ON a.i=b.i ORDER BY b.i, b.b
391393
----
394+
1 NULL NULL
392395
2 2 1
393396
3 3 0
394397
3 3 1
395398
NULL 4 0
396-
1 NULL NULL
397399

398400

399401
query IIIIII
@@ -438,8 +440,8 @@ SELECT * FROM (onecolumn AS a JOIN onecolumn AS b USING(y))
438440
query I
439441
SELECT * FROM (onecolumn AS a JOIN onecolumn AS b USING(x, x))
440442
----
441-
44
442443
42
444+
44
443445

444446
statement ok
445447
drop table if exists othertype
@@ -574,6 +576,7 @@ SELECT * FROM (SELECT * FROM pairs LEFT JOIN square ON b = sq AND a > 1 AND n <
574576
4 5 NULL NULL
575577
4 6 NULL NULL
576578

579+
onlyif todo
577580
query IIII
578581
SELECT * FROM (SELECT * FROM pairs RIGHT JOIN square ON b = sq AND a > 1 AND n < 6) WHERE (a IS NULL OR a > 2) AND n > 1 AND (a IS NULL OR a < sq) order by n
579582
----
@@ -755,9 +758,9 @@ SELECT * FROM xyu INNER JOIN xyv USING(x, y) WHERE x > 2
755758
query IIII
756759
SELECT * FROM xyu LEFT OUTER JOIN xyv USING(x, y) WHERE x > 2
757760
----
758-
3 1 31 31
759-
3 2 32 NULL
760-
4 4 44 NULL
761+
3 1 31 31
762+
3 2 32 NULL
763+
4 4 44 NULL
761764

762765
query IIII
763766
SELECT * FROM xyu RIGHT OUTER JOIN xyv USING(x, y) WHERE x > 2 order by y
@@ -954,10 +957,10 @@ SELECT * FROM foo JOIN bar USING (a, b) WHERE foo.c = bar.c AND foo.d = bar.d
954957
query TII
955958
SELECT * FROM onecolumn AS a(x) RIGHT JOIN twocolumn ON false order by y
956959
----
957-
NULL 45 45
960+
NULL 42 53
958961
NULL 44 51
962+
NULL 45 45
959963
NULL NULL 52
960-
NULL 42 53
961964

962965
statement ok
963966
SELECT * FROM onecolumn AS a(x) RIGHT JOIN twocolumn ON true where false order by y
@@ -1042,138 +1045,6 @@ select * from onecolumn as a left join twocolumn as b on a.x = b.x where b.x > 4
10421045
----
10431046
44 44 51
10441047

1045-
1046-
## check outer join is converted to inner join
1047-
1048-
query T
1049-
explain select * from onecolumn as a left join twocolumn as b on a.x = b.x where b.x > 42
1050-
----
1051-
HashJoin
1052-
├── join type: INNER
1053-
├── build keys: [b.x (#1)]
1054-
├── probe keys: [a.x (#0)]
1055-
├── filters: []
1056-
├── Filter(Build)
1057-
│ ├── filters: [>(b.x (#1), 42)]
1058-
│ └── TableScan
1059-
│ ├── table: default.default.twocolumn
1060-
│ ├── read rows: 4
1061-
│ ├── read bytes: 79
1062-
│ ├── partitions total: 1
1063-
│ ├── partitions scanned: 1
1064-
│ └── push downs: [filters: [(x > 42)], limit: NONE]
1065-
└── TableScan(Probe)
1066-
├── table: default.default.onecolumn
1067-
├── read rows: 4
1068-
├── read bytes: 62
1069-
├── partitions total: 2
1070-
├── partitions scanned: 2
1071-
└── push downs: [filters: [], limit: NONE]
1072-
1073-
query T
1074-
explain select * from onecolumn as a left join twocolumn as b on a.x = b.x where b.x > 44 or b.x < 43
1075-
----
1076-
HashJoin
1077-
├── join type: INNER
1078-
├── build keys: [b.x (#1)]
1079-
├── probe keys: [a.x (#0)]
1080-
├── filters: []
1081-
├── Filter(Build)
1082-
│ ├── filters: [or(>(b.x (#1), 44), <(b.x (#1), 43))]
1083-
│ └── TableScan
1084-
│ ├── table: default.default.twocolumn
1085-
│ ├── read rows: 4
1086-
│ ├── read bytes: 79
1087-
│ ├── partitions total: 1
1088-
│ ├── partitions scanned: 1
1089-
│ └── push downs: [filters: [((x > 44) or (x < 43))], limit: NONE]
1090-
└── TableScan(Probe)
1091-
├── table: default.default.onecolumn
1092-
├── read rows: 4
1093-
├── read bytes: 62
1094-
├── partitions total: 2
1095-
├── partitions scanned: 2
1096-
└── push downs: [filters: [], limit: NONE]
1097-
1098-
1099-
query T
1100-
explain select * from onecolumn as a left join twocolumn as b on a.x = b.x where b.x > 42 and b.x < 45
1101-
----
1102-
HashJoin
1103-
├── join type: INNER
1104-
├── build keys: [b.x (#1)]
1105-
├── probe keys: [a.x (#0)]
1106-
├── filters: []
1107-
├── Filter(Build)
1108-
│ ├── filters: [>(b.x (#1), 42), <(b.x (#1), 45)]
1109-
│ └── TableScan
1110-
│ ├── table: default.default.twocolumn
1111-
│ ├── read rows: 4
1112-
│ ├── read bytes: 79
1113-
│ ├── partitions total: 1
1114-
│ ├── partitions scanned: 1
1115-
│ └── push downs: [filters: [(x > 42), (x < 45)], limit: NONE]
1116-
└── TableScan(Probe)
1117-
├── table: default.default.onecolumn
1118-
├── read rows: 4
1119-
├── read bytes: 62
1120-
├── partitions total: 2
1121-
├── partitions scanned: 2
1122-
└── push downs: [filters: [], limit: NONE]
1123-
1124-
## the following cases won't be converted to inner join
1125-
1126-
query T
1127-
explain select * from onecolumn as a left join twocolumn as b on a.x = b.x where b.x > 44 or a.x < 43
1128-
----
1129-
Filter
1130-
├── filters: [or(>(b.x (#1), 44), <(a.x (#0), 43))]
1131-
└── HashJoin
1132-
├── join type: LEFT OUTER
1133-
├── build keys: [b.x (#1)]
1134-
├── probe keys: [a.x (#0)]
1135-
├── filters: []
1136-
├── TableScan(Build)
1137-
│ ├── table: default.default.twocolumn
1138-
│ ├── read rows: 4
1139-
│ ├── read bytes: 79
1140-
│ ├── partitions total: 1
1141-
│ ├── partitions scanned: 1
1142-
│ └── push downs: [filters: [], limit: NONE]
1143-
└── TableScan(Probe)
1144-
├── table: default.default.onecolumn
1145-
├── read rows: 4
1146-
├── read bytes: 62
1147-
├── partitions total: 2
1148-
├── partitions scanned: 2
1149-
└── push downs: [filters: [], limit: NONE]
1150-
1151-
query T
1152-
explain select * from onecolumn as a right join twocolumn as b on a.x = b.x where b.x > 42 and b.x < 45
1153-
----
1154-
HashJoin
1155-
├── join type: RIGHT OUTER
1156-
├── build keys: [b.x (#1)]
1157-
├── probe keys: [a.x (#0)]
1158-
├── filters: []
1159-
├── Filter(Build)
1160-
│ ├── filters: [>(b.x (#1), 42), <(b.x (#1), 45)]
1161-
│ └── TableScan
1162-
│ ├── table: default.default.twocolumn
1163-
│ ├── read rows: 4
1164-
│ ├── read bytes: 79
1165-
│ ├── partitions total: 1
1166-
│ ├── partitions scanned: 1
1167-
│ └── push downs: [filters: [(x > 42), (x < 45)], limit: NONE]
1168-
└── TableScan(Probe)
1169-
├── table: default.default.onecolumn
1170-
├── read rows: 4
1171-
├── read bytes: 62
1172-
├── partitions total: 2
1173-
├── partitions scanned: 2
1174-
└── push downs: [filters: [], limit: NONE]
1175-
1176-
11771048
## query
11781049
## SELECT column1, column1+1FROM (SELECT * FROM (VALUES (NULL, NULL)) AS t NATURAL FULL OUTER JOIN (VALUES (1, 1)) AS u)
11791050

@@ -1206,4 +1077,3 @@ HashJoin
12061077

12071078
## query
12081079
## SELECT abcd.*, dxby.* FROM abcd INNER JOIN dxby USING (d, b)
1209-

0 commit comments

Comments
 (0)