-
Notifications
You must be signed in to change notification settings - Fork 322
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d5bb465
commit 1437ce9
Showing
17 changed files
with
573 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
cases: | ||
- id: 0 | ||
desc: last join to a left join subquery | ||
inputs: | ||
- name: t1 | ||
columns: ["c1 string","c2 int","c4 timestamp"] | ||
indexs: ["index1:c1:c4"] | ||
rows: | ||
- ["aa",20,1000] | ||
- ["bb",30,1000] | ||
- ["cc",40,1000] | ||
- ["dd",50,1000] | ||
- name: t2 | ||
columns: ["c1 string","c4 timestamp"] | ||
indexs: ["index1:c1:c4"] | ||
rows: | ||
- ["aa",2000] | ||
- ["bb",2000] | ||
- ["cc",3000] | ||
- name: t3 | ||
columns: ["c1 string","c2 int","c3 bigint","c4 timestamp"] | ||
indexs: ["index1:c1:c4"] | ||
rows: | ||
- ["aa",19,13,3000] | ||
- ["aa",21,13,3000] | ||
- ["bb",34,131,3000] | ||
- ["bb",21,131,3000] | ||
sql: | | ||
select | ||
t1.c1, | ||
tx.c1 as c1l, | ||
tx.c1r, | ||
tx.c2r | ||
from t1 last join | ||
( | ||
select t2.c1 as c1, | ||
t3.c1 as c1r, | ||
t3.c2 as c2r | ||
from t2 left join t3 | ||
on t2.c1 = t3.c1 | ||
) tx | ||
on t1.c1 = tx.c1 and t1.c2 > tx.c2r | ||
batch_plan: | | ||
SIMPLE_PROJECT(sources=(t1.c1, tx.c1 -> c1l, tx.c1r, tx.c2r)) | ||
JOIN(type=LastJoin, condition=t1.c2 > tx.c2r, left_keys=(), right_keys=(), index_keys=(t1.c1)) | ||
DATA_PROVIDER(table=t1) | ||
RENAME(name=tx) | ||
SIMPLE_PROJECT(sources=(t2.c1, t3.c1 -> c1r, t3.c2 -> c2r)) | ||
JOIN(type=LeftJoin, condition=, left_keys=(), right_keys=(), index_keys=(t2.c1)) | ||
DATA_PROVIDER(type=Partition, table=t2, index=index1) | ||
DATA_PROVIDER(type=Partition, table=t3, index=index1) | ||
request_plan: | | ||
SIMPLE_PROJECT(sources=(t1.c1, tx.c1 -> c1l, tx.c1r, tx.c2r)) | ||
REQUEST_JOIN(type=LastJoin, condition=t1.c2 > tx.c2r, left_keys=(), right_keys=(), index_keys=(t1.c1)) | ||
DATA_PROVIDER(request=t1) | ||
RENAME(name=tx) | ||
SIMPLE_PROJECT(sources=(t2.c1, t3.c1 -> c1r, t3.c2 -> c2r)) | ||
REQUEST_JOIN(type=LeftJoin, condition=, left_keys=(), right_keys=(), index_keys=(t2.c1)) | ||
DATA_PROVIDER(type=Partition, table=t2, index=index1) | ||
DATA_PROVIDER(type=Partition, table=t3, index=index1) | ||
expect: | ||
order: c1 | ||
columns: ["c1 string", "c1l string", "c1r string", "c2r int"] | ||
data: | | ||
aa, aa, aa, 19 | ||
bb, bb, bb, 21 | ||
cc, NULL, NULL, NULL | ||
dd, NULL, NULL, NULL |
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
Oops, something went wrong.