-
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.
feat(sql): left join support for request mode
- POC version, may requires some refactor. - Requires more tests.
- Loading branch information
1 parent
08ad04e
commit 9ec4768
Showing
21 changed files
with
2,083 additions
and
1,610 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,50 @@ | ||
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 | ||
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
Oops, something went wrong.