Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support subquery in FROM clause #756

Merged
merged 26 commits into from
Jan 7, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d762e35
subuqery must hve an alias
MingjiHan99 Dec 30, 2022
f88620a
enhance binding
MingjiHan99 Dec 30, 2022
54d6e36
binder
MingjiHan99 Dec 30, 2022
c41c0c3
binder
MingjiHan99 Dec 30, 2022
5dcc43c
clippy
MingjiHan99 Dec 30, 2022
3229ce9
add id table
MingjiHan99 Dec 31, 2022
2943be6
add id table
MingjiHan99 Dec 31, 2022
597135e
add id table
MingjiHan99 Dec 31, 2022
4076721
resolve column type in subquery
MingjiHan99 Dec 31, 2022
5e8818e
fail
MingjiHan99 Dec 31, 2022
0e787fc
ongoing lol
MingjiHan99 Dec 31, 2022
50f85e1
introduce `as` node. refactor binder context
wangrunji0408 Dec 31, 2022
4e7b6d2
fix bugs to make subquery work
wangrunji0408 Dec 31, 2022
6794dba
keep `as` in schema
wangrunji0408 Jan 1, 2023
3ea58c3
update subquery test
wangrunji0408 Jan 1, 2023
51979f9
rename back to `ColumnRefId`
wangrunji0408 Jan 1, 2023
bc48ed0
revert test
wangrunji0408 Jan 1, 2023
9e5058b
remove the `as` node, rename `nested` node to `ref`
wangrunji0408 Jan 1, 2023
4451179
remove Option for schema
wangrunji0408 Jan 1, 2023
fa4ef54
fix clippy and ignore failed test
wangrunji0408 Jan 1, 2023
5a9e017
remove type analysis field
wangrunji0408 Jan 1, 2023
378be90
update planner test
wangrunji0408 Jan 1, 2023
9529062
remove `ColumnPrune` and `ColumnMerge` node
wangrunji0408 Jan 1, 2023
d2b604e
fix projection pushdown for join subqueries
wangrunji0408 Jan 1, 2023
1a54e4b
Merge branch 'main' into mingji-subquery-binder
wangrunji0408 Jan 7, 2023
e1142f1
fix planner test on CI
wangrunji0408 Jan 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update subquery test
Signed-off-by: Runji Wang <wangrunji0408@163.com>
  • Loading branch information
wangrunji0408 committed Jan 1, 2023
commit 3ea58c3b3766074bfc25d73a5b8dfc7f4e29a0ca
49 changes: 49 additions & 0 deletions tests/sql/subquery.slt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Test subquery

statement ok
create table t(a int not null, b int not null)

statement ok
insert into t values (1, 2), (3, 4)

query II
select a, b from (select a, b from t);
----
1 2
3 4

query II
select x.a, x.b from (select a, b from t) as x;
----
1 2
3 4

query II
select * from (select a, b from t);
----
1 2
3 4

query I
select s from (select a + b as s from t);
----
3
7

query II rowsort
select a, b from (select b from t), (select a from t);
----
1 2
1 4
3 2
3 4

query II rowsort
select x.a, y.a from
(select a as a from t) as x,
(select b as a from t) as y;
----
1 2
1 4
3 2
3 4
16 changes: 0 additions & 16 deletions tests/sql/subuqery.slt

This file was deleted.