Skip to content

feat(streaming): extend CREATE TABLE syntax to support creating append-only table source - #3058

Merged
StrikeW merged 8 commits into
mainfrom
siyuan/append-only
Jun 9, 2022
Merged

StrikeW merged 8 commits into
mainfrom
siyuan/append-only

Conversation

@StrikeW

@StrikeW StrikeW commented Jun 8, 2022 •

Copy link
Copy Markdown
Contributor

What's changed and what's your intention?

  1. extend CREATE TABLE syntax to support creating append-only table source
  2. return error when doing delete and update of an append-only table

Checklist

  • I have written necessary docs and comments
  • I have added necessary unit tests and integration tests
  • All checks passed in ./risedev check (or alias, ./risedev c)

Refer to a related PR or issue link (optional)

close #2962

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

license-eye has totally checked 833 files.

Valid Invalid Ignored Fixed
831 1 1 0
Click to see the invalid file list
  • src/frontend/test_runner/tests/gen/testcases.rs

Comment thread src/frontend/test_runner/tests/gen/testcases.rs Outdated

@skyzh skyzh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any planner test? see frontend/test_runner/README.md for more information.

Comment thread src/frontend/test_runner/tests/gen/testcases.rs Outdated
Comment thread src/frontend/src/optimizer/plan_node/stream_source.rs Outdated
@StrikeW
StrikeW force-pushed the siyuan/append-only branch from cac4970 to 29d1ab6 Compare June 8, 2022 06:14
@codecov

codecov Bot commented Jun 8, 2022 •

Copy link
Copy Markdown

Codecov Report

Merging #3058 (e6d8578) into main (43e0f29) will increase coverage by 0.01%.
The diff coverage is 85.00%.

@@            Coverage Diff             @@
##             main    #3058      +/-   ##
==========================================
+ Coverage   73.50%   73.52%   +0.01%     
==========================================
  Files         732      732              
  Lines       99398    99490      +92     
==========================================
+ Hits        73065    73148      +83     
- Misses      26333    26342       +9     
Flag Coverage Δ
rust 73.52% <85.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/common/src/catalog/physical_table.rs 0.00% <ø> (ø)
src/frontend/src/handler/explain.rs 0.00% <0.00%> (ø)
src/frontend/src/binder/delete.rs 76.19% <33.33%> (-17.15%) ⬇️
src/frontend/src/binder/update.rs 68.25% <33.33%> (-3.68%) ⬇️
...rontend/src/optimizer/plan_node/stream_hash_agg.rs 93.75% <87.50%> (-1.17%) ⬇️
...rc/frontend/src/binder/relation/table_or_source.rs 88.61% <100.00%> (+0.18%) ⬆️
src/frontend/src/catalog/source_catalog.rs 68.42% <100.00%> (+7.55%) ⬆️
src/frontend/src/catalog/table_catalog.rs 98.09% <100.00%> (+0.04%) ⬆️
src/frontend/src/handler/create_table.rs 96.62% <100.00%> (+0.21%) ⬆️
src/frontend/src/handler/mod.rs 64.77% <100.00%> (+1.24%) ⬆️
... and 15 more

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@skyzh skyzh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest LGTM

create table t1 (v1 int, v2 int) with ('appendonly' = true);
select v1, max(v2) as mx2 from t1 group by v1;
stream_plan: |
StreamMaterialize { columns: [v1, agg#0(hidden), mx2], pk_columns: [v1], appendonly: true }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This derivation is wrong. HashAgg will never produce append-only result. We can fix this later.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. you are right. The output of hash agg may produce update (U-, U+)

Comment thread src/frontend/test_runner/README.md
@StrikeW
StrikeW requested review from fuyufjh and st1page June 9, 2022 05:08
Comment thread src/frontend/src/optimizer/plan_node/stream_table_scan.rs Outdated
@StrikeW
StrikeW merged commit 978555e into main Jun 9, 2022
@StrikeW
StrikeW deleted the siyuan/append-only branch June 9, 2022 08:04
@hengm3467 hengm3467 added the user-facing-changes Contains changes that are visible to users label Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

user-facing-changes Contains changes that are visible to users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RFC: extend CREATE TABLE syntax to support creating append-only table source

4 participants