Skip to content

feat(parser): support emit_mode #7783

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

Merged
merged 3 commits into from
Feb 10, 2023
Merged

feat(parser): support emit_mode #7783

merged 3 commits into from
Feb 10, 2023

Conversation

TennyZhuang
Copy link
Contributor

Signed-off-by: TennyZhuang [email protected]

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

The parser part

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features).
  • I have demonstrated that backward compatibility is not broken by breaking changes and created issues to track deprecated features to be removed in the future. (Please refer the issue)
  • All checks passed in ./risedev check (or alias, ./risedev c)

Refer to a related PR or issue link (optional)

#6042

@github-actions github-actions bot added the type/feature Type: New feature. label Feb 8, 2023
@codecov
Copy link

codecov bot commented Feb 8, 2023

Codecov Report

Merging #7783 (923b6ca) into main (2d79894) will decrease coverage by 0.02%.
The diff coverage is 70.58%.

@@            Coverage Diff             @@
##             main    #7783      +/-   ##
==========================================
- Coverage   71.74%   71.73%   -0.02%     
==========================================
  Files        1107     1107              
  Lines      176388   176422      +34     
==========================================
+ Hits       126558   126564       +6     
- Misses      49830    49858      +28     
Flag Coverage Δ
rust 71.73% <70.58%> (-0.02%) ⬇️

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

Impacted Files Coverage Δ
src/sqlparser/src/keywords.rs 100.00% <ø> (ø)
src/frontend/src/handler/mod.rs 61.35% <37.50%> (-0.79%) ⬇️
src/sqlparser/src/parser.rs 91.94% <70.58%> (-0.14%) ⬇️
src/sqlparser/src/ast/mod.rs 88.88% <100.00%> (+0.08%) ⬆️
src/batch/src/executor/group_top_n.rs 68.23% <0.00%> (-6.48%) ⬇️
src/meta/src/hummock/mock_hummock_meta_client.rs 63.95% <0.00%> (-0.51%) ⬇️
src/batch/src/task/task_execution.rs 51.62% <0.00%> (-0.51%) ⬇️
src/object_store/src/object/mem.rs 86.48% <0.00%> (-0.39%) ⬇️
src/storage/src/hummock/compactor/iterator.rs 97.95% <0.00%> (-0.30%) ⬇️
src/storage/src/hummock/sstable_store.rs 64.57% <0.00%> (-0.16%) ⬇️
... and 1 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@BugenZhao BugenZhao left a comment

Choose a reason for hiding this comment

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

LGTM


#[test]
fn parse_create_materialized_view_emit_immediately() {
let sql = "CREATE MATERIALIZED VIEW myschema.myview EMIT IMMEDIATELY AS SELECT foo FROM bar";
Copy link
Collaborator

Choose a reason for hiding this comment

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

I thought it should be part of the query i.e. inside the SELECT ... clause. Did we change our mind?

Copy link
Contributor Author

@TennyZhuang TennyZhuang Feb 9, 2023

Choose a reason for hiding this comment

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

If we defined them on SELECT, what's the semantic on subquery or CTE?

Currently, our conclusion is that we should ensure a mview or a sink can only have one emit option, the only way is defined on view.

Copy link
Collaborator

Choose a reason for hiding this comment

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

risingwavelabs/rfcs#30 defines the semantics in terms of relational algebra (i.e. given input set, what should be the output set), so the semantics is still well-defined for subqueries or CTEs.

@mergify mergify bot merged commit df6b157 into main Feb 10, 2023
@mergify mergify bot deleted the feat/parse-emit branch February 10, 2023 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature Type: New feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants