Skip to content

Commit 36a22ea

Browse files
committed
fix tests
1 parent 02b9f62 commit 36a22ea

7 files changed

+230
-173
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
SELECT x, y FROM (SELECT number AS x FROM system.numbers LIMIT 3) js1 CROSS JOIN (SELECT number AS y FROM system.numbers LIMIT 5) js2;
1+
SELECT x, y FROM (SELECT number AS x FROM system.numbers LIMIT 3) js1 CROSS JOIN (SELECT number AS y FROM system.numbers LIMIT 5) js2 ORDER BY x, y;
22

33
SET join_algorithm = 'auto';
4-
SELECT x, y FROM (SELECT number AS x FROM system.numbers LIMIT 3) js1 CROSS JOIN (SELECT number AS y FROM system.numbers LIMIT 5) js2;
4+
SELECT x, y FROM (SELECT number AS x FROM system.numbers LIMIT 3) js1 CROSS JOIN (SELECT number AS y FROM system.numbers LIMIT 5) js2 ORDER BY x, y;
55

66
-- Just to test that we preserved old setting name this we use `enable_analyzer` instead of `enable_analyzer` here.
77
SET enable_analyzer = 1;
8-
SELECT x, y FROM (SELECT number AS x FROM system.numbers LIMIT 3) js1 CROSS JOIN (SELECT number AS y FROM system.numbers LIMIT 5) js2;
8+
SELECT x, y FROM (SELECT number AS x FROM system.numbers LIMIT 3) js1 CROSS JOIN (SELECT number AS y FROM system.numbers LIMIT 5) js2 ORDER BY x, y;

tests/queries/0_stateless/01763_filter_push_down_bugs.reference

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,26 @@ Expression ((Projection + Before ORDER BY))
3030
Ranges: 1
3131
Expression ((Project names + Projection))
3232
Filter (WHERE)
33-
Join (JOIN FillRightFirst)
34-
Expression ((WHERE + Change column names to column identifiers))
35-
ReadFromMergeTree (default.t1)
36-
Indexes:
37-
PrimaryKey
38-
Keys:
39-
id
40-
Condition: (id in [101, 101])
41-
Parts: 1/1
42-
Granules: 1/1
43-
Search Algorithm: binary search
44-
Ranges: 1
45-
Expression ((Change column names to column identifiers + (Project names + (Projection + Change column names to column identifiers))))
46-
ReadFromMergeTree (default.t2)
47-
Indexes:
48-
PrimaryKey
49-
Condition: true
50-
Parts: 1/1
51-
Granules: 1/1
52-
Ranges: 1
33+
Expression (Post Join Actions)
34+
Join
35+
Expression (Left Pre Join Actions)
36+
Expression ((WHERE + Change column names to column identifiers))
37+
ReadFromMergeTree (default.t1)
38+
Indexes:
39+
PrimaryKey
40+
Keys:
41+
id
42+
Condition: (id in [101, 101])
43+
Parts: 1/1
44+
Granules: 1/1
45+
Search Algorithm: binary search
46+
Ranges: 1
47+
Expression (Right Pre Join Actions)
48+
Expression ((Change column names to column identifiers + (Project names + (Projection + Change column names to column identifiers))))
49+
ReadFromMergeTree (default.t2)
50+
Indexes:
51+
PrimaryKey
52+
Condition: true
53+
Parts: 1/1
54+
Granules: 1/1
55+
Ranges: 1

tests/queries/0_stateless/02496_remove_redundant_sorting_analyzer.reference

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,14 @@ ORDER BY t1.number, t2.number
118118
Expression (Project names)
119119
Sorting (Sorting for ORDER BY)
120120
Expression ((Before ORDER BY + Projection))
121-
Join (JOIN FillRightFirst)
122-
Expression ((Change column names to column identifiers + (Project names + (Before ORDER BY + (Projection + (Change column names to column identifiers + (Project names + (Before ORDER BY + (Projection + Change column names to column identifiers)))))))))
123-
ReadFromSystemNumbers
124-
Expression ((Change column names to column identifiers + (Project names + (Before ORDER BY + (Projection + (Change column names to column identifiers + (Project names + (Before ORDER BY + (Projection + Change column names to column identifiers)))))))))
125-
ReadFromSystemNumbers
121+
Expression (Post Join Actions)
122+
Join
123+
Expression (Left Pre Join Actions)
124+
Expression ((Change column names to column identifiers + (Project names + (Before ORDER BY + (Projection + (Change column names to column identifiers + (Project names + (Before ORDER BY + (Projection + Change column names to column identifiers)))))))))
125+
ReadFromSystemNumbers
126+
Expression (Right Pre Join Actions)
127+
Expression ((Change column names to column identifiers + (Project names + (Before ORDER BY + (Projection + (Change column names to column identifiers + (Project names + (Before ORDER BY + (Projection + Change column names to column identifiers)))))))))
128+
ReadFromSystemNumbers
126129
-- execute
127130
0 0
128131
0 1
@@ -162,11 +165,14 @@ ORDER BY t1.number, t2.number
162165
Expression (Project names)
163166
Sorting (Sorting for ORDER BY)
164167
Expression ((Before ORDER BY + Projection))
165-
Join (JOIN FillRightFirst)
166-
Expression ((Change column names to column identifiers + (Project names + (Before ORDER BY + (Projection + (Change column names to column identifiers + (Project names + (Before ORDER BY + (Projection + Change column names to column identifiers)))))))))
167-
ReadFromSystemNumbers
168-
Expression ((Change column names to column identifiers + (Project names + (Before ORDER BY + (Projection + (Change column names to column identifiers + (Project names + (Before ORDER BY + (Projection + Change column names to column identifiers)))))))))
169-
ReadFromSystemNumbers
168+
Expression (Post Join Actions)
169+
Join
170+
Expression (Left Pre Join Actions)
171+
Expression ((Change column names to column identifiers + (Project names + (Before ORDER BY + (Projection + (Change column names to column identifiers + (Project names + (Before ORDER BY + (Projection + Change column names to column identifiers)))))))))
172+
ReadFromSystemNumbers
173+
Expression (Right Pre Join Actions)
174+
Expression ((Change column names to column identifiers + (Project names + (Before ORDER BY + (Projection + (Change column names to column identifiers + (Project names + (Before ORDER BY + (Projection + Change column names to column identifiers)))))))))
175+
ReadFromSystemNumbers
170176
-- execute
171177
0 0
172178
0 1

tests/queries/0_stateless/02500_remove_redundant_distinct_analyzer.reference

Lines changed: 78 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,20 @@ Expression (Project names)
8080
Expression (Before ORDER BY)
8181
Distinct (Preliminary DISTINCT)
8282
Expression (Projection)
83-
Join (JOIN FillRightFirst)
84-
Expression ((Change column names to column identifiers + Project names))
85-
Distinct (DISTINCT)
86-
Distinct (Preliminary DISTINCT)
87-
Expression ((Projection + Change column names to column identifiers))
88-
ReadFromSystemNumbers
89-
Expression ((Change column names to column identifiers + Project names))
90-
Distinct (DISTINCT)
91-
Distinct (Preliminary DISTINCT)
92-
Expression ((Projection + Change column names to column identifiers))
93-
ReadFromSystemNumbers
83+
Expression (Post Join Actions)
84+
Join
85+
Expression (Left Pre Join Actions)
86+
Expression ((Change column names to column identifiers + Project names))
87+
Distinct (DISTINCT)
88+
Distinct (Preliminary DISTINCT)
89+
Expression ((Projection + Change column names to column identifiers))
90+
ReadFromSystemNumbers
91+
Expression (Right Pre Join Actions)
92+
Expression ((Change column names to column identifiers + Project names))
93+
Distinct (DISTINCT)
94+
Distinct (Preliminary DISTINCT)
95+
Expression ((Projection + Change column names to column identifiers))
96+
ReadFromSystemNumbers
9497
-- execute
9598
0 0
9699
0 1
@@ -245,11 +248,14 @@ Expression ((Project names + (Projection + (Change column names to column identi
245248
Expression ((Before ORDER BY + Projection))
246249
Aggregating
247250
Expression ((Before GROUP BY + (Change column names to column identifiers + (Project names + Projection))))
248-
Join (JOIN FillRightFirst)
249-
Expression (Change column names to column identifiers)
250-
ReadFromSystemNumbers
251-
Expression (Change column names to column identifiers)
252-
ReadFromSystemNumbers
251+
Expression (Post Join Actions)
252+
Join
253+
Expression (Left Pre Join Actions)
254+
Expression (Change column names to column identifiers)
255+
ReadFromSystemNumbers
256+
Expression (Right Pre Join Actions)
257+
Expression (Change column names to column identifiers)
258+
ReadFromSystemNumbers
253259
-- execute
254260
0
255261
1
@@ -281,11 +287,14 @@ Expression (Project names)
281287
Expression ((Before ORDER BY + Projection))
282288
Aggregating
283289
Expression ((Before GROUP BY + (Change column names to column identifiers + (Project names + Projection))))
284-
Join (JOIN FillRightFirst)
285-
Expression (Change column names to column identifiers)
286-
ReadFromSystemNumbers
287-
Expression (Change column names to column identifiers)
288-
ReadFromSystemNumbers
290+
Expression (Post Join Actions)
291+
Join
292+
Expression (Left Pre Join Actions)
293+
Expression (Change column names to column identifiers)
294+
ReadFromSystemNumbers
295+
Expression (Right Pre Join Actions)
296+
Expression (Change column names to column identifiers)
297+
ReadFromSystemNumbers
289298
-- execute
290299
12
291300
-- GROUP BY WITH ROLLUP before DISTINCT with on different columns => do _not_ remove DISTINCT
@@ -316,11 +325,14 @@ Expression (Project names)
316325
Rollup
317326
Aggregating
318327
Expression ((Before GROUP BY + (Change column names to column identifiers + (Project names + Projection))))
319-
Join (JOIN FillRightFirst)
320-
Expression (Change column names to column identifiers)
321-
ReadFromSystemNumbers
322-
Expression (Change column names to column identifiers)
323-
ReadFromSystemNumbers
328+
Expression (Post Join Actions)
329+
Join
330+
Expression (Left Pre Join Actions)
331+
Expression (Change column names to column identifiers)
332+
ReadFromSystemNumbers
333+
Expression (Right Pre Join Actions)
334+
Expression (Change column names to column identifiers)
335+
ReadFromSystemNumbers
324336
-- execute
325337
12
326338
36
@@ -349,11 +361,14 @@ Expression ((Project names + (Projection + (Change column names to column identi
349361
Rollup
350362
Aggregating
351363
Expression ((Before GROUP BY + (Change column names to column identifiers + (Project names + Projection))))
352-
Join (JOIN FillRightFirst)
353-
Expression (Change column names to column identifiers)
354-
ReadFromSystemNumbers
355-
Expression (Change column names to column identifiers)
356-
ReadFromSystemNumbers
364+
Expression (Post Join Actions)
365+
Join
366+
Expression (Left Pre Join Actions)
367+
Expression (Change column names to column identifiers)
368+
ReadFromSystemNumbers
369+
Expression (Right Pre Join Actions)
370+
Expression (Change column names to column identifiers)
371+
ReadFromSystemNumbers
357372
-- execute
358373
0
359374
0
@@ -387,11 +402,14 @@ Expression (Project names)
387402
Cube
388403
Aggregating
389404
Expression ((Before GROUP BY + (Change column names to column identifiers + (Project names + Projection))))
390-
Join (JOIN FillRightFirst)
391-
Expression (Change column names to column identifiers)
392-
ReadFromSystemNumbers
393-
Expression (Change column names to column identifiers)
394-
ReadFromSystemNumbers
405+
Expression (Post Join Actions)
406+
Join
407+
Expression (Left Pre Join Actions)
408+
Expression (Change column names to column identifiers)
409+
ReadFromSystemNumbers
410+
Expression (Right Pre Join Actions)
411+
Expression (Change column names to column identifiers)
412+
ReadFromSystemNumbers
395413
-- execute
396414
12
397415
36
@@ -420,11 +438,14 @@ Expression ((Project names + (Projection + (Change column names to column identi
420438
Cube
421439
Aggregating
422440
Expression ((Before GROUP BY + (Change column names to column identifiers + (Project names + Projection))))
423-
Join (JOIN FillRightFirst)
424-
Expression (Change column names to column identifiers)
425-
ReadFromSystemNumbers
426-
Expression (Change column names to column identifiers)
427-
ReadFromSystemNumbers
441+
Expression (Post Join Actions)
442+
Join
443+
Expression (Left Pre Join Actions)
444+
Expression (Change column names to column identifiers)
445+
ReadFromSystemNumbers
446+
Expression (Right Pre Join Actions)
447+
Expression (Change column names to column identifiers)
448+
ReadFromSystemNumbers
428449
-- execute
429450
0
430451
0
@@ -458,11 +479,14 @@ Expression (Project names)
458479
TotalsHaving
459480
Aggregating
460481
Expression ((Before GROUP BY + (Change column names to column identifiers + (Project names + Projection))))
461-
Join (JOIN FillRightFirst)
462-
Expression (Change column names to column identifiers)
463-
ReadFromSystemNumbers
464-
Expression (Change column names to column identifiers)
465-
ReadFromSystemNumbers
482+
Expression (Post Join Actions)
483+
Join
484+
Expression (Left Pre Join Actions)
485+
Expression (Change column names to column identifiers)
486+
ReadFromSystemNumbers
487+
Expression (Right Pre Join Actions)
488+
Expression (Change column names to column identifiers)
489+
ReadFromSystemNumbers
466490
-- execute
467491
12
468492

@@ -492,11 +516,14 @@ Expression ((Project names + (Projection + (Change column names to column identi
492516
TotalsHaving
493517
Aggregating
494518
Expression ((Before GROUP BY + (Change column names to column identifiers + (Project names + Projection))))
495-
Join (JOIN FillRightFirst)
496-
Expression (Change column names to column identifiers)
497-
ReadFromSystemNumbers
498-
Expression (Change column names to column identifiers)
499-
ReadFromSystemNumbers
519+
Expression (Post Join Actions)
520+
Join
521+
Expression (Left Pre Join Actions)
522+
Expression (Change column names to column identifiers)
523+
ReadFromSystemNumbers
524+
Expression (Right Pre Join Actions)
525+
Expression (Change column names to column identifiers)
526+
ReadFromSystemNumbers
500527
-- execute
501528
0
502529
1

tests/queries/0_stateless/03302_analyzer_join_filter_push_down_bug.reference

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,34 @@ Positions: 0
2020
FUNCTION greaterOrEquals(__table2.value :: 1, toDateTime(toString(__table3.value)) :: 2) -> greaterOrEquals(__table2.value, toDateTime(toString(__table3.value))) UInt8 : 3
2121
ALIAS greaterOrEquals(__table2.value, toDateTime(toString(__table3.value))) :: 3 -> and(greaterOrEquals(__table2.value, toDateTime(toString(__table3.value))), equals(__table1.key, 1626... UInt8 : 2
2222
Positions: 2
23-
Join (JOIN FillRightFirst)
24-
Type: CROSS
25-
Strictness: UNSPECIFIED
26-
Algorithm: HashJoin
27-
Filter ((((WHERE + (Change column names to column identifiers + (Project names + Projection))) + WHERE) + Change column names to column identifiers))
28-
Filter column: equals(__table2.key, 162601_UInt32) (removed)
29-
Actions: INPUT : 0 -> key Int32 : 0
30-
INPUT : 1 -> value DateTime : 1
31-
COLUMN Const(UInt32) -> 162601_UInt32 UInt32 : 2
32-
ALIAS key : 0 -> __table2.key Int32 : 3
33-
ALIAS value :: 1 -> __table2.value DateTime : 4
34-
FUNCTION equals(key :: 0, 162601_UInt32 :: 2) -> equals(__table2.key, 162601_UInt32) UInt8 : 1
35-
Positions: 1 3 4
36-
ReadFromStorage (Log)
37-
Expression (Change column names to column identifiers)
38-
Actions: INPUT : 0 -> value DateTime : 0
39-
ALIAS value :: 0 -> __table3.value DateTime : 1
40-
Positions: 1
41-
ReadFromStorage (Log)
23+
Expression (Post Join Actions)
24+
Actions: INPUT :: 0 -> __table2.key Int32 : 0
25+
INPUT :: 1 -> __table2.value DateTime : 1
26+
INPUT :: 2 -> __table3.value DateTime : 2
27+
Positions: 0 1 2
28+
Join
29+
Type: CROSS
30+
Strictness: ALL
31+
Algorithm: HashJoin
32+
Expression (Left Pre Join Actions)
33+
Actions: INPUT :: 0 -> __table2.key Int32 : 0
34+
INPUT :: 1 -> __table2.value DateTime : 1
35+
Positions: 0 1
36+
Filter ((((WHERE + (Change column names to column identifiers + (Project names + Projection))) + WHERE) + Change column names to column identifiers))
37+
Filter column: equals(__table2.key, 162601_UInt32) (removed)
38+
Actions: INPUT : 0 -> key Int32 : 0
39+
INPUT : 1 -> value DateTime : 1
40+
COLUMN Const(UInt32) -> 162601_UInt32 UInt32 : 2
41+
ALIAS key : 0 -> __table2.key Int32 : 3
42+
ALIAS value :: 1 -> __table2.value DateTime : 4
43+
FUNCTION equals(key :: 0, 162601_UInt32 :: 2) -> equals(__table2.key, 162601_UInt32) UInt8 : 1
44+
Positions: 1 3 4
45+
ReadFromStorage (Log)
46+
Expression (Right Pre Join Actions)
47+
Actions: INPUT :: 0 -> __table3.value DateTime : 0
48+
Positions: 0
49+
Expression (Change column names to column identifiers)
50+
Actions: INPUT : 0 -> value DateTime : 0
51+
ALIAS value :: 0 -> __table3.value DateTime : 1
52+
Positions: 1
53+
ReadFromStorage (Log)

0 commit comments

Comments
 (0)