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: new table stream graph #12240

Merged
merged 25 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
59faa8f
Added modules and commented code blocks in `create_table.rs`. Importe…
shanicky Sep 11, 2023
7b2266e
Delete "recursive.rs" & modify `PlanRoot` struct logic for `stream_pl…
shanicky Sep 12, 2023
daccb1c
Remove println! statement, introduce is_external_source variable.
shanicky Sep 12, 2023
7906775
Refactor assigning source ID
shanicky Sep 12, 2023
945bb99
Modify distribution key in StreamTableScan and BatchScan operations f…
shanicky Sep 19, 2023
d60511c
Code changes: import type, add function, refactor code, add enum vari…
shanicky Sep 19, 2023
02e8e33
Code cleanup: Removal of unnecessary println! statements
shanicky Sep 19, 2023
a9b6c41
Update `no_shuffle.rs`: new import, predicate added, test case updated.
shanicky Sep 19, 2023
6f6c007
Import `Serial` type, add `fallback_row_id`, and modify `map` functio…
shanicky Sep 20, 2023
1c50108
Remove `Union` import, add `GenericPlanNode` import.
shanicky Oct 23, 2023
9343c67
Modified table scan and exchange distribution in query plan. Updated …
shanicky Oct 30, 2023
34be31c
Modified file vnode.rs: updated use statement, changed behavior of it…
shanicky Nov 7, 2023
3cb69c2
Add compute_row() method to VirtualNode implementation
shanicky Nov 7, 2023
d469547
update dapt
shanicky Nov 8, 2023
a5aa40b
add assert back
shanicky Nov 8, 2023
c6b0ba1
Update optimizer/mod.rs & optimizer/plan_node/stream_union.rs. Create…
shanicky Nov 13, 2023
ab9dc01
Modify `unique` method & simplify logic for creating new `StreamRowId…
shanicky Nov 13, 2023
8479f43
rollback
shanicky Nov 13, 2023
379e20a
Added `VirtualNode::compute_row`, removed logic for empty `project`.
shanicky Nov 13, 2023
f905f87
Update "create materialized view" clause & add comment about hash dif…
shanicky Nov 14, 2023
e12d2fa
Added StreamExchange operator with HashShard distribution strategy to…
shanicky Nov 14, 2023
0b87816
Add StreamUnion & StreamExchange operators for shuffling, modify Stre…
shanicky Nov 14, 2023
9eb0db1
Remove commented out portion, refactor code to clone and use input's …
shanicky Nov 14, 2023
2e447d8
Skip empty sources, fill ID with connector, generate random server ID…
shanicky Nov 14, 2023
9a89780
try update e2e
shanicky Nov 14, 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
94 changes: 47 additions & 47 deletions e2e_test/batch/aggregate/jsonb_agg.slt.part
Original file line number Diff line number Diff line change
Expand Up @@ -12,79 +12,79 @@ insert into t values
(true, 3, 'aaa', '{}', '2021-01-01 03:00:00', '3 days');

query T
select jsonb_agg(v1) from t;
select jsonb_agg(v1 order by v1) from t;
----
[null, false, true, true]
[false, true, true, null]

query T
select jsonb_agg(v2::int2) from t;
select jsonb_agg(v2::int2 order by v2) from t;
----
[null, 1, 2, 3]
[1, 2, 3, null]

query T
select jsonb_agg(v2::int4) from t;
select jsonb_agg(v2::int4 order by v2) from t;
----
[null, 1, 2, 3]
[1, 2, 3, null]

query T
select jsonb_agg(v2::int8) from t;
select jsonb_agg(v2::int8 order by v2) from t;
----
[null, 1, 2, 3]
[1, 2, 3, null]

query T
select jsonb_agg(v2::float4) from t;
select jsonb_agg(v2::float4 order by v2) from t;
----
[null, 1.0, 2.0, 3.0]
[1.0, 2.0, 3.0, null]

query T
select jsonb_agg(v2::float8) from t;
select jsonb_agg(v2::float8 order by v2) from t;
----
[null, 1.0, 2.0, 3.0]
[1.0, 2.0, 3.0, null]

query T
select jsonb_agg(v2::decimal) from t;
select jsonb_agg(v2::decimal order by v2) from t;
----
[null, 1.0, 2.0, 3.0]
[1.0, 2.0, 3.0, null]

query T
select jsonb_agg(v3) from t;
select jsonb_agg(v3 order by v3) from t;
----
[null, "ccc", "bbb", "aaa"]
["aaa", "bbb", "ccc", null]

query T
select jsonb_agg(v3::bytea) from t;
select jsonb_agg(v3::bytea order by v3) from t;
----
[null, "\\x636363", "\\x626262", "\\x616161"]
["\\x616161", "\\x626262", "\\x636363", null]

query T
select jsonb_agg(v4) from t;
select jsonb_agg(v4 order by v4) from t;
----
[null, null, false, {}]
[false, null, {}, null]

query T
select jsonb_agg(v5::date) from t;
select jsonb_agg(v5::date order by v5) from t;
----
[null, "2019-01-01", "2020-01-01", "2021-01-01"]
["2019-01-01", "2020-01-01", "2021-01-01", null]

query T
select jsonb_agg(v5::time) from t;
select jsonb_agg(v5::time order by v5) from t;
----
[null, "01:00:00", "02:00:00", "03:00:00"]
["01:00:00", "02:00:00", "03:00:00", null]

query T
select jsonb_agg(v5::timestamp) from t;
select jsonb_agg(v5::timestamp order by v5) from t;
----
[null, "2019-01-01T01:00:00", "2020-01-01T02:00:00", "2021-01-01T03:00:00"]
["2019-01-01T01:00:00", "2020-01-01T02:00:00", "2021-01-01T03:00:00", null]

query T
select jsonb_agg(v5::timestamptz) from t;
select jsonb_agg(v5::timestamptz order by v5) from t;
----
[null, "2019-01-01T01:00:00+00:00", "2020-01-01T02:00:00+00:00", "2021-01-01T03:00:00+00:00"]
["2019-01-01T01:00:00+00:00", "2020-01-01T02:00:00+00:00", "2021-01-01T03:00:00+00:00", null]

query T
select jsonb_agg(v6) from t;
select jsonb_agg(v6 order by v6) from t;
----
[null, "1 day", "2 days", "3 days"]
["1 day", "2 days", "3 days", null]

# query T
# select jsonb_agg(distinct v1) from t;
Expand All @@ -97,85 +97,85 @@ select jsonb_agg(v2 order by v3 desc) from t;
[null, 1, 2, 3]

query T
select jsonb_agg(v2) filter (where v3 >= 'bbb') from t;
select jsonb_agg(v2 order by v3) filter (where v3 >= 'bbb') from t;
----
[1, 2]
[2, 1]

statement error field name must not be null
select jsonb_object_agg(v3, v1) from t;

query T
select jsonb_object_agg(v3, v1) filter (where v3 is not null) from t;
select jsonb_object_agg(v3, v1 order by v3) filter (where v3 is not null) from t;
----
{"aaa": true, "bbb": true, "ccc": false}

query T
select jsonb_object_agg(v3, v2::int2) filter (where v3 is not null) from t;
select jsonb_object_agg(v3, v2::int2 order by v3) filter (where v3 is not null) from t;
----
{"aaa": 3, "bbb": 2, "ccc": 1}

query T
select jsonb_object_agg(v3, v2::int4) filter (where v3 is not null) from t;
select jsonb_object_agg(v3, v2::int4 order by v3) filter (where v3 is not null) from t;
----
{"aaa": 3, "bbb": 2, "ccc": 1}

query T
select jsonb_object_agg(v3, v2::int8) filter (where v3 is not null) from t;
select jsonb_object_agg(v3, v2::int8 order by v3) filter (where v3 is not null) from t;
----
{"aaa": 3, "bbb": 2, "ccc": 1}

query T
select jsonb_object_agg(v3, v2::float4) filter (where v3 is not null) from t;
select jsonb_object_agg(v3, v2::float4 order by v3) filter (where v3 is not null) from t;
----
{"aaa": 3.0, "bbb": 2.0, "ccc": 1.0}

query T
select jsonb_object_agg(v3, v2::float8) filter (where v3 is not null) from t;
select jsonb_object_agg(v3, v2::float8 order by v3) filter (where v3 is not null) from t;
----
{"aaa": 3.0, "bbb": 2.0, "ccc": 1.0}

query T
select jsonb_object_agg(v3, v2::decimal) filter (where v3 is not null) from t;
select jsonb_object_agg(v3, v2::decimal order by v3) filter (where v3 is not null) from t;
----
{"aaa": 3.0, "bbb": 2.0, "ccc": 1.0}

query T
select jsonb_object_agg(v3, v3) filter (where v3 is not null) from t;
select jsonb_object_agg(v3, v3 order by v3) filter (where v3 is not null) from t;
----
{"aaa": "aaa", "bbb": "bbb", "ccc": "ccc"}

query T
select jsonb_object_agg(v3, v3::bytea) filter (where v3 is not null) from t;
select jsonb_object_agg(v3, v3::bytea order by v3) filter (where v3 is not null) from t;
----
{"aaa": "\\x616161", "bbb": "\\x626262", "ccc": "\\x636363"}

query T
select jsonb_object_agg(v3, v4) filter (where v3 is not null) from t;
select jsonb_object_agg(v3, v4 order by v3) filter (where v3 is not null) from t;
----
{"aaa": {}, "bbb": false, "ccc": null}

query T
select jsonb_object_agg(v3, v5::date) filter (where v3 is not null) from t;
select jsonb_object_agg(v3, v5::date order by v3) filter (where v3 is not null) from t;
----
{"aaa": "2021-01-01", "bbb": "2020-01-01", "ccc": "2019-01-01"}

query T
select jsonb_object_agg(v3, v5::time) filter (where v3 is not null) from t;
select jsonb_object_agg(v3, v5::time order by v3) filter (where v3 is not null) from t;
----
{"aaa": "03:00:00", "bbb": "02:00:00", "ccc": "01:00:00"}

query T
select jsonb_object_agg(v3, v5::timestamp) filter (where v3 is not null) from t;
select jsonb_object_agg(v3, v5::timestamp order by v3) filter (where v3 is not null) from t;
----
{"aaa": "2021-01-01T03:00:00", "bbb": "2020-01-01T02:00:00", "ccc": "2019-01-01T01:00:00"}

query T
select jsonb_object_agg(v3, v5::timestamptz) filter (where v3 is not null) from t;
select jsonb_object_agg(v3, v5::timestamptz order by v3) filter (where v3 is not null) from t;
----
{"aaa": "2021-01-01T03:00:00+00:00", "bbb": "2020-01-01T02:00:00+00:00", "ccc": "2019-01-01T01:00:00+00:00"}

query T
select jsonb_object_agg(v3, v6) filter (where v3 is not null) from t;
select jsonb_object_agg(v3, v6 order by v3) filter (where v3 is not null) from t;
----
{"aaa": "3 days", "bbb": "2 days", "ccc": "1 day"}

Expand Down
4 changes: 2 additions & 2 deletions e2e_test/batch/basic/table_with_default_columns.slt.part
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ create table t2 (v1 int, v2 int default 1.5);
statement ok
insert into t2 values (1), (2);

query II
query II rowsort
select * from t2;
----
1 2
Expand All @@ -76,7 +76,7 @@ select * from t2;
statement ok
alter table t2 add column v3 timestamp with time zone default now();

query IT
query IT rowsort
select v1, v3 >= date '2021-01-01' as later_than_2021 from t2;
----
1 t
Expand Down
Loading
Loading