Skip to content

Commit

Permalink
apply planner test
Browse files Browse the repository at this point in the history
Signed-off-by: Yuchen Liang <yuchenl3@andrew.cmu.edu>
  • Loading branch information
yliang412 committed Dec 22, 2024
1 parent cecc8a3 commit fa66727
Show file tree
Hide file tree
Showing 7 changed files with 194 additions and 265 deletions.
207 changes: 86 additions & 121 deletions optd-sqlplannertest/tests/subqueries/subquery_unnesting.planner.sql

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions optd-sqlplannertest/tests/tpch/q16.planner.sql
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,7 @@ PhysicalSort
│ ├── 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 }
│ └── Not
│ └── [ #14 ]
└── PhysicalNestedLoopJoin
├── join_type: LeftMark
├── cond:Eq
│ ├── #1
│ └── #14
└── PhysicalHashJoin { join_type: LeftMark, left_keys: [ #1 ], right_keys: [ #0 ] }
├── PhysicalNestedLoopJoin { join_type: Inner, cond: true }
│ ├── PhysicalScan { table: partsupp }
│ └── PhysicalScan { table: part }
Expand Down
88 changes: 42 additions & 46 deletions optd-sqlplannertest/tests/tpch/q17.planner.sql
Original file line number Diff line number Diff line change
Expand Up @@ -78,52 +78,48 @@ PhysicalProjection
└── PhysicalNestedLoopJoin
├── join_type: Inner
├── cond:And
│ ├── Eq
│ │ ├── #16
│ │ └── #1
│ └── Lt
│ ├── Cast { cast_to: Decimal128(30, 15), child: #4 }
│ └── #26
├── PhysicalScan { table: lineitem }
└── PhysicalHashJoin { join_type: Inner, left_keys: [ #0 ], right_keys: [ #0 ] }
├── PhysicalFilter
│ ├── cond:And
│ │ ├── Eq
│ │ │ ├── #3
│ │ │ └── "Brand#13"
│ │ └── Eq
│ │ ├── #6
│ │ └── "JUMBO PKG"
│ └── PhysicalScan { table: part }
└── PhysicalProjection
├── exprs:
│ ┌── #0
│ └── Cast
│ ├── cast_to: Decimal128(30, 15)
│ ├── child:Mul
│ │ ├── 0.2(float)
│ │ └── Cast { cast_to: Float64, child: #1 }
│ ├── Lt
│ │ ├── Cast { cast_to: Decimal128(30, 15), child: #4 }
│ │ └── #26
│ └── Eq
│ ├── #16
│ └── #25
├── 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 ] }
│ └── PhysicalHashJoin { join_type: Inner, left_keys: [ #0 ], right_keys: [ #1 ] }
│ ├── PhysicalFilter
│ │ ├── cond:And
│ │ │ ├── Eq
│ │ │ │ ├── #3
│ │ │ │ └── "Brand#13"
│ │ │ └── Eq
│ │ │ ├── #6
│ │ │ └── "JUMBO PKG"
│ │ └── PhysicalScan { table: part }
│ └── PhysicalScan { table: lineitem }
└── PhysicalProjection
├── exprs:
│ ┌── #0
│ └── Cast
│ ├── cast_to: Decimal128(30, 15)
│ ├── child:Mul
│ │ ├── 0.2(float)
│ │ └── Cast { cast_to: Float64, child: #1 }
└── PhysicalProjection { exprs: [ #0, #2 ] }
└── PhysicalNestedLoopJoin
├── join_type: LeftOuter
├── cond:And
│ └── Eq
│ ├── #0
│ └── #1
├── PhysicalAgg { aggrs: [], groups: [ #16 ] }
│ └── PhysicalNestedLoopJoin { join_type: Inner, cond: true }
│ ├── PhysicalScan { table: lineitem }
│ └── PhysicalScan { table: part }
└── PhysicalAgg
├── aggrs:Agg(Avg)
│ └── [ #5 ]
├── groups: [ #0 ]
└── PhysicalHashJoin { join_type: Inner, left_keys: [ #0 ], right_keys: [ #1 ] }
├── PhysicalAgg { aggrs: [], groups: [ #16 ] }
│ └── PhysicalNestedLoopJoin { join_type: Inner, cond: true }
│ ├── PhysicalScan { table: lineitem }
│ └── PhysicalScan { table: part }
└── PhysicalScan { table: lineitem }
└── PhysicalProjection { exprs: [ #0, #2 ] }
└── PhysicalHashJoin { join_type: LeftOuter, left_keys: [ #0 ], right_keys: [ #0 ] }
├── PhysicalAgg { aggrs: [], groups: [ #16 ] }
│ └── PhysicalNestedLoopJoin { join_type: Inner, cond: true }
│ ├── PhysicalScan { table: lineitem }
│ └── PhysicalScan { table: part }
└── PhysicalAgg
├── aggrs:Agg(Avg)
│ └── [ #5 ]
├── groups: [ #0 ]
└── PhysicalHashJoin { join_type: Inner, left_keys: [ #0 ], right_keys: [ #1 ] }
├── PhysicalAgg { aggrs: [], groups: [ #16 ] }
│ └── PhysicalNestedLoopJoin { join_type: Inner, cond: true }
│ ├── PhysicalScan { table: lineitem }
│ └── PhysicalScan { table: part }
└── PhysicalScan { table: lineitem }
*/

7 changes: 1 addition & 6 deletions optd-sqlplannertest/tests/tpch/q2.planner.sql
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,7 @@ PhysicalLimit { skip: 0(i64), fetch: 100(i64) }
│ │ └── "AFRICA"
│ └── PhysicalScan { table: region }
└── PhysicalProjection { exprs: [ #0, #2 ] }
└── PhysicalNestedLoopJoin
├── join_type: LeftOuter
├── cond:And
│ └── Eq
│ ├── #0
│ └── #1
└── PhysicalHashJoin { join_type: LeftOuter, left_keys: [ #0 ], right_keys: [ #0 ] }
├── PhysicalAgg { aggrs: [], groups: [ #0 ] }
│ └── PhysicalNestedLoopJoin { join_type: Inner, cond: true }
│ ├── PhysicalNestedLoopJoin { join_type: Inner, cond: true }
Expand Down
137 changes: 62 additions & 75 deletions optd-sqlplannertest/tests/tpch/q20.planner.sql
Original file line number Diff line number Diff line change
Expand Up @@ -106,84 +106,71 @@ PhysicalSort
│ └── Eq
│ ├── #8
│ └── "IRAQ"
└── PhysicalNestedLoopJoin
├── join_type: LeftMark
├── cond:Eq
│ ├── #0
│ └── #11
└── PhysicalHashJoin { join_type: LeftMark, left_keys: [ #0 ], right_keys: [ #0 ] }
├── PhysicalNestedLoopJoin { join_type: Inner, cond: true }
│ ├── PhysicalScan { table: supplier }
│ └── PhysicalScan { table: nation }
└── PhysicalProjection { exprs: [ #1 ] }
└── PhysicalProjection { exprs: [ #3, #4, #5, #6, #7, #8, #0, #1, #2 ] }
└── PhysicalFilter
├── cond:And
│ ├── #8
│ └── Gt
│ ├── Cast { cast_to: Float64, child: #5 }
│ └── #2
└── PhysicalHashJoin { join_type: Inner, left_keys: [ #0, #1 ], right_keys: [ #0, #1 ] }
├── PhysicalProjection
│ ├── exprs:
│ │ ┌── #0
│ │ ├── #1
│ │ └── Mul
│ │ ├── 0.5(float)
│ │ └── Cast { cast_to: Float64, child: #2 }
│ └── PhysicalProjection { exprs: [ #0, #1, #4 ] }
│ └── PhysicalNestedLoopJoin
│ ├── join_type: LeftOuter
│ ├── cond:And
│ │ ├── Eq
│ │ │ ├── #0
│ │ │ └── #2
│ │ └── Eq
│ │ ├── #1
│ │ └── #3
│ ├── PhysicalAgg { aggrs: [], groups: [ #0, #1 ] }
│ │ └── PhysicalNestedLoopJoin
│ │ ├── join_type: LeftMark
│ │ ├── cond:Eq
│ │ │ ├── #0
│ │ │ └── #5
│ │ ├── PhysicalScan { table: partsupp }
│ │ └── PhysicalProjection { exprs: [ #0 ] }
│ │ └── PhysicalFilter { cond: Like { expr: #1, pattern: "indian%", negated: false, case_insensitive: false } }
│ │ └── PhysicalScan { table: part }
│ └── PhysicalAgg
│ ├── aggrs:Agg(Sum)
│ │ └── [ #6 ]
│ ├── groups: [ #0, #1 ]
│ └── PhysicalHashJoin { join_type: Inner, left_keys: [ #0, #1 ], right_keys: [ #1, #2 ] }
│ ├── PhysicalAgg { aggrs: [], groups: [ #0, #1 ] }
│ │ └── PhysicalNestedLoopJoin
│ │ ├── join_type: LeftMark
│ │ ├── cond:Eq
│ │ │ ├── #0
│ │ │ └── #5
│ │ ├── PhysicalScan { table: partsupp }
│ │ └── PhysicalProjection { exprs: [ #0 ] }
│ │ └── PhysicalFilter { cond: Like { expr: #1, pattern: "indian%", negated: false, case_insensitive: false } }
│ │ └── PhysicalScan { table: part }
│ └── PhysicalFilter
│ ├── cond:And
│ │ ├── Geq
│ │ │ ├── #10
│ │ │ └── Cast { cast_to: Date32, child: "1996-01-01" }
│ │ └── Lt
│ │ ├── #10
│ │ └── Add
│ │ ├── Cast { cast_to: Date32, child: "1996-01-01" }
│ │ └── INTERVAL_MONTH_DAY_NANO (12, 0, 0)
│ └── PhysicalScan { table: lineitem }
└── PhysicalNestedLoopJoin
├── join_type: LeftMark
├── cond:Eq
│ ├── #0
│ └── #5
├── PhysicalScan { table: partsupp }
└── PhysicalProjection { exprs: [ #0 ] }
└── PhysicalFilter { cond: Like { expr: #1, pattern: "indian%", negated: false, case_insensitive: false } }
└── PhysicalScan { table: part }
└── PhysicalNestedLoopJoin
├── join_type: Inner
├── cond:And
│ ├── Gt
│ │ ├── Cast { cast_to: Float64, child: #2 }
│ │ └── #8
│ ├── Eq
│ │ ├── #0
│ │ └── #6
│ └── Eq
│ ├── #1
│ └── #7
├── PhysicalFilter { cond: #5 }
│ └── PhysicalHashJoin { join_type: LeftMark, left_keys: [ #0 ], right_keys: [ #0 ] }
│ ├── PhysicalScan { table: partsupp }
│ └── PhysicalProjection { exprs: [ #0 ] }
│ └── PhysicalFilter { cond: Like { expr: #1, pattern: "indian%", negated: false, case_insensitive: false } }
│ └── PhysicalScan { table: part }
└── PhysicalProjection
├── exprs:
│ ┌── #0
│ ├── #1
│ └── Mul
│ ├── 0.5(float)
│ └── Cast { cast_to: Float64, child: #2 }
└── PhysicalProjection { exprs: [ #0, #1, #4 ] }
└── PhysicalHashJoin { join_type: LeftOuter, left_keys: [ #0, #1 ], right_keys: [ #0, #1 ] }
├── PhysicalAgg { aggrs: [], groups: [ #0, #1 ] }
│ └── PhysicalHashJoin { join_type: LeftMark, left_keys: [ #0 ], right_keys: [ #0 ] }
│ ├── PhysicalScan { table: partsupp }
│ └── PhysicalProjection { exprs: [ #0 ] }
│ └── PhysicalFilter { cond: Like { expr: #1, pattern: "indian%", negated: false, case_insensitive: false } }
│ └── PhysicalScan { table: part }
└── PhysicalAgg
├── aggrs:Agg(Sum)
│ └── [ #6 ]
├── groups: [ #0, #1 ]
└── PhysicalFilter
├── cond:And
│ ├── Eq
│ │ ├── #3
│ │ └── #0
│ ├── Eq
│ │ ├── #4
│ │ └── #1
│ ├── Geq
│ │ ├── #12
│ │ └── Cast { cast_to: Date32, child: "1996-01-01" }
│ └── Lt
│ ├── #12
│ └── Add
│ ├── Cast { cast_to: Date32, child: "1996-01-01" }
│ └── INTERVAL_MONTH_DAY_NANO (12, 0, 0)
└── PhysicalNestedLoopJoin { join_type: Inner, cond: true }
├── PhysicalAgg { aggrs: [], groups: [ #0, #1 ] }
│ └── PhysicalHashJoin { join_type: LeftMark, left_keys: [ #0 ], right_keys: [ #0 ] }
│ ├── PhysicalScan { table: partsupp }
│ └── PhysicalProjection { exprs: [ #0 ] }
│ └── PhysicalFilter { cond: Like { expr: #1, pattern: "indian%", negated: false, case_insensitive: false } }
│ └── PhysicalScan { table: part }
└── PhysicalScan { table: lineitem }
*/

7 changes: 1 addition & 6 deletions optd-sqlplannertest/tests/tpch/q22.planner.sql
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,7 @@ PhysicalSort
│ │ └── #8
│ └── Not
│ └── [ #9 ]
└── PhysicalNestedLoopJoin
├── join_type: LeftMark
├── cond:And
│ └── Eq
│ ├── #0
│ └── #9
└── PhysicalHashJoin { join_type: LeftMark, left_keys: [ #0 ], right_keys: [ #0 ] }
├── PhysicalNestedLoopJoin { join_type: Inner, cond: true }
│ ├── PhysicalScan { table: customer }
│ └── PhysicalAgg
Expand Down
7 changes: 1 addition & 6 deletions optd-sqlplannertest/tests/tpch/q4.planner.sql
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,7 @@ PhysicalSort
│ │ ├── Cast { cast_to: Date32, child: "1993-07-01" }
│ │ └── INTERVAL_MONTH_DAY_NANO (3, 0, 0)
│ └── #9
└── PhysicalNestedLoopJoin
├── join_type: LeftMark
├── cond:And
│ └── Eq
│ ├── #0
│ └── #9
└── PhysicalHashJoin { join_type: LeftMark, left_keys: [ #0 ], right_keys: [ #0 ] }
├── PhysicalScan { table: orders }
└── PhysicalProjection { exprs: [ #16, #0, #1, #2, #3, #4, #5, #6, #7, #8, #9, #10, #11, #12, #13, #14, #15 ] }
└── PhysicalHashJoin { join_type: Inner, left_keys: [ #0 ], right_keys: [ #0 ] }
Expand Down

0 comments on commit fa66727

Please sign in to comment.