-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(df-repr): join assoc rule expr, rm exploding rules (#223)
Signed-off-by: Alex Chi <[email protected]>
- Loading branch information
Showing
13 changed files
with
338 additions
and
341 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
-- (no id or description) | ||
create table t1(a int, b int); | ||
create table t2(c int, d int); | ||
create table t3(e int, f int); | ||
create table t4(g int, h int); | ||
|
||
/* | ||
*/ | ||
|
||
-- test 3-way join | ||
select * from t1, t2, t3 where a = c AND d = e; | ||
|
||
/* | ||
LogicalProjection { exprs: [ #0, #1, #2, #3, #4, #5 ] } | ||
└── LogicalFilter | ||
├── cond:And | ||
│ ├── Eq | ||
│ │ ├── #0 | ||
│ │ └── #2 | ||
│ └── Eq | ||
│ ├── #3 | ||
│ └── #4 | ||
└── LogicalJoin { join_type: Cross, cond: true } | ||
├── LogicalJoin { join_type: Cross, cond: true } | ||
│ ├── LogicalScan { table: t1 } | ||
│ └── LogicalScan { table: t2 } | ||
└── LogicalScan { table: t3 } | ||
PhysicalHashJoin { join_type: Inner, left_keys: [ #0 ], right_keys: [ #0 ] } | ||
├── PhysicalScan { table: t1 } | ||
└── PhysicalHashJoin { join_type: Inner, left_keys: [ #1 ], right_keys: [ #0 ] } | ||
├── PhysicalScan { table: t2 } | ||
└── PhysicalScan { table: t3 } | ||
*/ | ||
|
||
-- test 3-way join | ||
select * from t1, t2, t3 where a = c AND b = e; | ||
|
||
/* | ||
LogicalProjection { exprs: [ #0, #1, #2, #3, #4, #5 ] } | ||
└── LogicalFilter | ||
├── cond:And | ||
│ ├── Eq | ||
│ │ ├── #0 | ||
│ │ └── #2 | ||
│ └── Eq | ||
│ ├── #1 | ||
│ └── #4 | ||
└── LogicalJoin { join_type: Cross, cond: true } | ||
├── LogicalJoin { join_type: Cross, cond: true } | ||
│ ├── LogicalScan { table: t1 } | ||
│ └── LogicalScan { table: t2 } | ||
└── LogicalScan { table: t3 } | ||
PhysicalHashJoin { join_type: Inner, left_keys: [ #1 ], right_keys: [ #0 ] } | ||
├── PhysicalHashJoin { join_type: Inner, left_keys: [ #0 ], right_keys: [ #0 ] } | ||
│ ├── PhysicalScan { table: t1 } | ||
│ └── PhysicalScan { table: t2 } | ||
└── PhysicalScan { table: t3 } | ||
*/ | ||
|
||
-- test 4-way join | ||
select * from t1, t2, t3, t4 where a = c AND b = e AND f = g; | ||
|
||
/* | ||
LogicalProjection { exprs: [ #0, #1, #2, #3, #4, #5, #6, #7 ] } | ||
└── LogicalFilter | ||
├── cond:And | ||
│ ├── Eq | ||
│ │ ├── #0 | ||
│ │ └── #2 | ||
│ ├── Eq | ||
│ │ ├── #1 | ||
│ │ └── #4 | ||
│ └── Eq | ||
│ ├── #5 | ||
│ └── #6 | ||
└── LogicalJoin { join_type: Cross, cond: true } | ||
├── LogicalJoin { join_type: Cross, cond: true } | ||
│ ├── LogicalJoin { join_type: Cross, cond: true } | ||
│ │ ├── LogicalScan { table: t1 } | ||
│ │ └── LogicalScan { table: t2 } | ||
│ └── LogicalScan { table: t3 } | ||
└── LogicalScan { table: t4 } | ||
PhysicalHashJoin { join_type: Inner, left_keys: [ #1 ], right_keys: [ #0 ] } | ||
├── PhysicalHashJoin { join_type: Inner, left_keys: [ #0 ], right_keys: [ #0 ] } | ||
│ ├── PhysicalScan { table: t1 } | ||
│ └── PhysicalScan { table: t2 } | ||
└── PhysicalHashJoin { join_type: Inner, left_keys: [ #1 ], right_keys: [ #0 ] } | ||
├── PhysicalScan { table: t3 } | ||
└── PhysicalScan { table: t4 } | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
- sql: | | ||
create table t1(a int, b int); | ||
create table t2(c int, d int); | ||
create table t3(e int, f int); | ||
create table t4(g int, h int); | ||
tasks: | ||
- execute | ||
- sql: | | ||
select * from t1, t2, t3 where a = c AND d = e; | ||
desc: test 3-way join | ||
tasks: | ||
- explain:logical_optd,physical_optd | ||
- sql: | | ||
select * from t1, t2, t3 where a = c AND b = e; | ||
desc: test 3-way join | ||
tasks: | ||
- explain:logical_optd,physical_optd | ||
- sql: | | ||
select * from t1, t2, t3, t4 where a = c AND b = e AND f = g; | ||
desc: test 4-way join | ||
tasks: | ||
- explain:logical_optd,physical_optd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.