Skip to content
This repository was archived by the owner on Jan 7, 2025. It is now read-only.

Commit fa66727

Browse files
committed
apply planner test
Signed-off-by: Yuchen Liang <[email protected]>
1 parent cecc8a3 commit fa66727

File tree

7 files changed

+194
-265
lines changed

7 files changed

+194
-265
lines changed

optd-sqlplannertest/tests/subqueries/subquery_unnesting.planner.sql

Lines changed: 86 additions & 121 deletions
Large diffs are not rendered by default.

optd-sqlplannertest/tests/tpch/q16.planner.sql

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,7 @@ PhysicalSort
9191
│ ├── InList { expr: Cast { cast_to: Int64, child: #10 }, list: [ 49(i64), 14(i64), 23(i64), 45(i64), 19(i64), 3(i64), 36(i64), 9(i64) ], negated: false }
9292
│ └── Not
9393
│ └── [ #14 ]
94-
└── PhysicalNestedLoopJoin
95-
├── join_type: LeftMark
96-
├── cond:Eq
97-
│ ├── #1
98-
│ └── #14
94+
└── PhysicalHashJoin { join_type: LeftMark, left_keys: [ #1 ], right_keys: [ #0 ] }
9995
├── PhysicalNestedLoopJoin { join_type: Inner, cond: true }
10096
│ ├── PhysicalScan { table: partsupp }
10197
│ └── PhysicalScan { table: part }

optd-sqlplannertest/tests/tpch/q17.planner.sql

Lines changed: 42 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -78,52 +78,48 @@ PhysicalProjection
7878
└── PhysicalNestedLoopJoin
7979
├── join_type: Inner
8080
├── cond:And
81-
│ ├── Eq
82-
│ │ ├── #16
83-
│ │ └── #1
84-
│ └── Lt
85-
│ ├── Cast { cast_to: Decimal128(30, 15), child: #4 }
86-
│ └── #26
87-
├── PhysicalScan { table: lineitem }
88-
└── PhysicalHashJoin { join_type: Inner, left_keys: [ #0 ], right_keys: [ #0 ] }
89-
├── PhysicalFilter
90-
│ ├── cond:And
91-
│ │ ├── Eq
92-
│ │ │ ├── #3
93-
│ │ │ └── "Brand#13"
94-
│ │ └── Eq
95-
│ │ ├── #6
96-
│ │ └── "JUMBO PKG"
97-
│ └── PhysicalScan { table: part }
98-
└── PhysicalProjection
99-
├── exprs:
100-
│ ┌── #0
101-
│ └── Cast
102-
│ ├── cast_to: Decimal128(30, 15)
103-
│ ├── child:Mul
104-
│ │ ├── 0.2(float)
105-
│ │ └── Cast { cast_to: Float64, child: #1 }
81+
│ ├── Lt
82+
│ │ ├── Cast { cast_to: Decimal128(30, 15), child: #4 }
83+
│ │ └── #26
84+
│ └── Eq
85+
│ ├── #16
86+
│ └── #25
87+
├── PhysicalProjection { exprs: [ #9, #10, #11, #12, #13, #14, #15, #16, #17, #18, #19, #20, #21, #22, #23, #24, #0, #1, #2, #3, #4, #5, #6, #7, #8 ] }
88+
│ └── PhysicalHashJoin { join_type: Inner, left_keys: [ #0 ], right_keys: [ #1 ] }
89+
│ ├── PhysicalFilter
90+
│ │ ├── cond:And
91+
│ │ │ ├── Eq
92+
│ │ │ │ ├── #3
93+
│ │ │ │ └── "Brand#13"
94+
│ │ │ └── Eq
95+
│ │ │ ├── #6
96+
│ │ │ └── "JUMBO PKG"
97+
│ │ └── PhysicalScan { table: part }
98+
│ └── PhysicalScan { table: lineitem }
99+
└── PhysicalProjection
100+
├── exprs:
101+
│ ┌── #0
102+
│ └── Cast
103+
│ ├── cast_to: Decimal128(30, 15)
104+
│ ├── child:Mul
105+
│ │ ├── 0.2(float)
106+
│ │ └── Cast { cast_to: Float64, child: #1 }
106107
107-
└── PhysicalProjection { exprs: [ #0, #2 ] }
108-
└── PhysicalNestedLoopJoin
109-
├── join_type: LeftOuter
110-
├── cond:And
111-
│ └── Eq
112-
│ ├── #0
113-
│ └── #1
114-
├── PhysicalAgg { aggrs: [], groups: [ #16 ] }
115-
│ └── PhysicalNestedLoopJoin { join_type: Inner, cond: true }
116-
│ ├── PhysicalScan { table: lineitem }
117-
│ └── PhysicalScan { table: part }
118-
└── PhysicalAgg
119-
├── aggrs:Agg(Avg)
120-
│ └── [ #5 ]
121-
├── groups: [ #0 ]
122-
└── PhysicalHashJoin { join_type: Inner, left_keys: [ #0 ], right_keys: [ #1 ] }
123-
├── PhysicalAgg { aggrs: [], groups: [ #16 ] }
124-
│ └── PhysicalNestedLoopJoin { join_type: Inner, cond: true }
125-
│ ├── PhysicalScan { table: lineitem }
126-
│ └── PhysicalScan { table: part }
127-
└── PhysicalScan { table: lineitem }
108+
└── PhysicalProjection { exprs: [ #0, #2 ] }
109+
└── PhysicalHashJoin { join_type: LeftOuter, left_keys: [ #0 ], right_keys: [ #0 ] }
110+
├── PhysicalAgg { aggrs: [], groups: [ #16 ] }
111+
│ └── PhysicalNestedLoopJoin { join_type: Inner, cond: true }
112+
│ ├── PhysicalScan { table: lineitem }
113+
│ └── PhysicalScan { table: part }
114+
└── PhysicalAgg
115+
├── aggrs:Agg(Avg)
116+
│ └── [ #5 ]
117+
├── groups: [ #0 ]
118+
└── PhysicalHashJoin { join_type: Inner, left_keys: [ #0 ], right_keys: [ #1 ] }
119+
├── PhysicalAgg { aggrs: [], groups: [ #16 ] }
120+
│ └── PhysicalNestedLoopJoin { join_type: Inner, cond: true }
121+
│ ├── PhysicalScan { table: lineitem }
122+
│ └── PhysicalScan { table: part }
123+
└── PhysicalScan { table: lineitem }
128124
*/
129125

optd-sqlplannertest/tests/tpch/q2.planner.sql

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -262,12 +262,7 @@ PhysicalLimit { skip: 0(i64), fetch: 100(i64) }
262262
│ │ └── "AFRICA"
263263
│ └── PhysicalScan { table: region }
264264
└── PhysicalProjection { exprs: [ #0, #2 ] }
265-
└── PhysicalNestedLoopJoin
266-
├── join_type: LeftOuter
267-
├── cond:And
268-
│ └── Eq
269-
│ ├── #0
270-
│ └── #1
265+
└── PhysicalHashJoin { join_type: LeftOuter, left_keys: [ #0 ], right_keys: [ #0 ] }
271266
├── PhysicalAgg { aggrs: [], groups: [ #0 ] }
272267
│ └── PhysicalNestedLoopJoin { join_type: Inner, cond: true }
273268
│ ├── PhysicalNestedLoopJoin { join_type: Inner, cond: true }

optd-sqlplannertest/tests/tpch/q20.planner.sql

Lines changed: 62 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -106,84 +106,71 @@ PhysicalSort
106106
│ └── Eq
107107
│ ├── #8
108108
│ └── "IRAQ"
109-
└── PhysicalNestedLoopJoin
110-
├── join_type: LeftMark
111-
├── cond:Eq
112-
│ ├── #0
113-
│ └── #11
109+
└── PhysicalHashJoin { join_type: LeftMark, left_keys: [ #0 ], right_keys: [ #0 ] }
114110
├── PhysicalNestedLoopJoin { join_type: Inner, cond: true }
115111
│ ├── PhysicalScan { table: supplier }
116112
│ └── PhysicalScan { table: nation }
117113
└── PhysicalProjection { exprs: [ #1 ] }
118-
└── PhysicalProjection { exprs: [ #3, #4, #5, #6, #7, #8, #0, #1, #2 ] }
119-
└── PhysicalFilter
120-
├── cond:And
121-
│ ├── #8
122-
│ └── Gt
123-
│ ├── Cast { cast_to: Float64, child: #5 }
124-
│ └── #2
125-
└── PhysicalHashJoin { join_type: Inner, left_keys: [ #0, #1 ], right_keys: [ #0, #1 ] }
126-
├── PhysicalProjection
127-
│ ├── exprs:
128-
│ │ ┌── #0
129-
│ │ ├── #1
130-
│ │ └── Mul
131-
│ │ ├── 0.5(float)
132-
│ │ └── Cast { cast_to: Float64, child: #2 }
133-
│ └── PhysicalProjection { exprs: [ #0, #1, #4 ] }
134-
│ └── PhysicalNestedLoopJoin
135-
│ ├── join_type: LeftOuter
136-
│ ├── cond:And
137-
│ │ ├── Eq
138-
│ │ │ ├── #0
139-
│ │ │ └── #2
140-
│ │ └── Eq
141-
│ │ ├── #1
142-
│ │ └── #3
143-
│ ├── PhysicalAgg { aggrs: [], groups: [ #0, #1 ] }
144-
│ │ └── PhysicalNestedLoopJoin
145-
│ │ ├── join_type: LeftMark
146-
│ │ ├── cond:Eq
147-
│ │ │ ├── #0
148-
│ │ │ └── #5
149-
│ │ ├── PhysicalScan { table: partsupp }
150-
│ │ └── PhysicalProjection { exprs: [ #0 ] }
151-
│ │ └── PhysicalFilter { cond: Like { expr: #1, pattern: "indian%", negated: false, case_insensitive: false } }
152-
│ │ └── PhysicalScan { table: part }
153-
│ └── PhysicalAgg
154-
│ ├── aggrs:Agg(Sum)
155-
│ │ └── [ #6 ]
156-
│ ├── groups: [ #0, #1 ]
157-
│ └── PhysicalHashJoin { join_type: Inner, left_keys: [ #0, #1 ], right_keys: [ #1, #2 ] }
158-
│ ├── PhysicalAgg { aggrs: [], groups: [ #0, #1 ] }
159-
│ │ └── PhysicalNestedLoopJoin
160-
│ │ ├── join_type: LeftMark
161-
│ │ ├── cond:Eq
162-
│ │ │ ├── #0
163-
│ │ │ └── #5
164-
│ │ ├── PhysicalScan { table: partsupp }
165-
│ │ └── PhysicalProjection { exprs: [ #0 ] }
166-
│ │ └── PhysicalFilter { cond: Like { expr: #1, pattern: "indian%", negated: false, case_insensitive: false } }
167-
│ │ └── PhysicalScan { table: part }
168-
│ └── PhysicalFilter
169-
│ ├── cond:And
170-
│ │ ├── Geq
171-
│ │ │ ├── #10
172-
│ │ │ └── Cast { cast_to: Date32, child: "1996-01-01" }
173-
│ │ └── Lt
174-
│ │ ├── #10
175-
│ │ └── Add
176-
│ │ ├── Cast { cast_to: Date32, child: "1996-01-01" }
177-
│ │ └── INTERVAL_MONTH_DAY_NANO (12, 0, 0)
178-
│ └── PhysicalScan { table: lineitem }
179-
└── PhysicalNestedLoopJoin
180-
├── join_type: LeftMark
181-
├── cond:Eq
182-
│ ├── #0
183-
│ └── #5
184-
├── PhysicalScan { table: partsupp }
185-
└── PhysicalProjection { exprs: [ #0 ] }
186-
└── PhysicalFilter { cond: Like { expr: #1, pattern: "indian%", negated: false, case_insensitive: false } }
187-
└── PhysicalScan { table: part }
114+
└── PhysicalNestedLoopJoin
115+
├── join_type: Inner
116+
├── cond:And
117+
│ ├── Gt
118+
│ │ ├── Cast { cast_to: Float64, child: #2 }
119+
│ │ └── #8
120+
│ ├── Eq
121+
│ │ ├── #0
122+
│ │ └── #6
123+
│ └── Eq
124+
│ ├── #1
125+
│ └── #7
126+
├── PhysicalFilter { cond: #5 }
127+
│ └── PhysicalHashJoin { join_type: LeftMark, left_keys: [ #0 ], right_keys: [ #0 ] }
128+
│ ├── PhysicalScan { table: partsupp }
129+
│ └── PhysicalProjection { exprs: [ #0 ] }
130+
│ └── PhysicalFilter { cond: Like { expr: #1, pattern: "indian%", negated: false, case_insensitive: false } }
131+
│ └── PhysicalScan { table: part }
132+
└── PhysicalProjection
133+
├── exprs:
134+
│ ┌── #0
135+
│ ├── #1
136+
│ └── Mul
137+
│ ├── 0.5(float)
138+
│ └── Cast { cast_to: Float64, child: #2 }
139+
└── PhysicalProjection { exprs: [ #0, #1, #4 ] }
140+
└── PhysicalHashJoin { join_type: LeftOuter, left_keys: [ #0, #1 ], right_keys: [ #0, #1 ] }
141+
├── PhysicalAgg { aggrs: [], groups: [ #0, #1 ] }
142+
│ └── PhysicalHashJoin { join_type: LeftMark, left_keys: [ #0 ], right_keys: [ #0 ] }
143+
│ ├── PhysicalScan { table: partsupp }
144+
│ └── PhysicalProjection { exprs: [ #0 ] }
145+
│ └── PhysicalFilter { cond: Like { expr: #1, pattern: "indian%", negated: false, case_insensitive: false } }
146+
│ └── PhysicalScan { table: part }
147+
└── PhysicalAgg
148+
├── aggrs:Agg(Sum)
149+
│ └── [ #6 ]
150+
├── groups: [ #0, #1 ]
151+
└── PhysicalFilter
152+
├── cond:And
153+
│ ├── Eq
154+
│ │ ├── #3
155+
│ │ └── #0
156+
│ ├── Eq
157+
│ │ ├── #4
158+
│ │ └── #1
159+
│ ├── Geq
160+
│ │ ├── #12
161+
│ │ └── Cast { cast_to: Date32, child: "1996-01-01" }
162+
│ └── Lt
163+
│ ├── #12
164+
│ └── Add
165+
│ ├── Cast { cast_to: Date32, child: "1996-01-01" }
166+
│ └── INTERVAL_MONTH_DAY_NANO (12, 0, 0)
167+
└── PhysicalNestedLoopJoin { join_type: Inner, cond: true }
168+
├── PhysicalAgg { aggrs: [], groups: [ #0, #1 ] }
169+
│ └── PhysicalHashJoin { join_type: LeftMark, left_keys: [ #0 ], right_keys: [ #0 ] }
170+
│ ├── PhysicalScan { table: partsupp }
171+
│ └── PhysicalProjection { exprs: [ #0 ] }
172+
│ └── PhysicalFilter { cond: Like { expr: #1, pattern: "indian%", negated: false, case_insensitive: false } }
173+
│ └── PhysicalScan { table: part }
174+
└── PhysicalScan { table: lineitem }
188175
*/
189176

optd-sqlplannertest/tests/tpch/q22.planner.sql

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,7 @@ PhysicalSort
121121
│ │ └── #8
122122
│ └── Not
123123
│ └── [ #9 ]
124-
└── PhysicalNestedLoopJoin
125-
├── join_type: LeftMark
126-
├── cond:And
127-
│ └── Eq
128-
│ ├── #0
129-
│ └── #9
124+
└── PhysicalHashJoin { join_type: LeftMark, left_keys: [ #0 ], right_keys: [ #0 ] }
130125
├── PhysicalNestedLoopJoin { join_type: Inner, cond: true }
131126
│ ├── PhysicalScan { table: customer }
132127
│ └── PhysicalAgg

optd-sqlplannertest/tests/tpch/q4.planner.sql

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,7 @@ PhysicalSort
7171
│ │ ├── Cast { cast_to: Date32, child: "1993-07-01" }
7272
│ │ └── INTERVAL_MONTH_DAY_NANO (3, 0, 0)
7373
│ └── #9
74-
└── PhysicalNestedLoopJoin
75-
├── join_type: LeftMark
76-
├── cond:And
77-
│ └── Eq
78-
│ ├── #0
79-
│ └── #9
74+
└── PhysicalHashJoin { join_type: LeftMark, left_keys: [ #0 ], right_keys: [ #0 ] }
8075
├── PhysicalScan { table: orders }
8176
└── PhysicalProjection { exprs: [ #16, #0, #1, #2, #3, #4, #5, #6, #7, #8, #9, #10, #11, #12, #13, #14, #15 ] }
8277
└── PhysicalHashJoin { join_type: Inner, left_keys: [ #0 ], right_keys: [ #0 ] }

0 commit comments

Comments
 (0)