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(frontend): implementation for create/drop sink handlers #3488

Merged
merged 93 commits into from
Jul 4, 2022

Conversation

nanderstabel
Copy link
Contributor

@nanderstabel nanderstabel commented Jun 27, 2022

I hereby agree to the terms of the Singularity Data, Inc. Contributor License Agreement.

What's changed and what's your intention?

Add handle for CREATE SINK and DROP SINK statements as well as test_utils.

Please explain IN DETAIL what the changes are in this PR and why they are needed:

  • Summarize your change (mandatory)

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)

Documentation

If your pull request contains user-facing changes, please specify the types of the changes, and create a release note. Otherwise, please feel free to remove this section.

Types of user-facing changes

Please keep the types that apply to your changes, and remove those that do not apply.

  • SQL commands, functions, and operators

Release note

Please create a release note for your changes. In the release note, focus on the impact on users, and mention the environment or conditions where the impact may occur.

support the following syntax

create sink {{ sink_name }} from mv/table with (...);

drop sink {{ sink_name }};

Refer to a related PR or issue link (optional)

@nanderstabel nanderstabel changed the title Ns sink frontend feat(frontend): implementation for create/drop sink handlers Jun 28, 2022
@codecov
Copy link

codecov bot commented Jun 28, 2022

Codecov Report

Merging #3488 (55e9c10) into main (dc165bb) will increase coverage by 0.03%.
The diff coverage is 93.80%.

@@            Coverage Diff             @@
##             main    #3488      +/-   ##
==========================================
+ Coverage   74.31%   74.35%   +0.03%     
==========================================
  Files         773      775       +2     
  Lines      109868   110074     +206     
==========================================
+ Hits        81647    81843     +196     
- Misses      28221    28231      +10     
Flag Coverage Δ
rust 74.35% <93.80%> (+0.03%) ⬆️

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

Impacted Files Coverage Δ
src/frontend/src/catalog/catalog_service.rs 6.60% <0.00%> (-0.40%) ⬇️
src/frontend/src/catalog/mod.rs 75.00% <ø> (ø)
src/frontend/src/handler/show.rs 89.43% <0.00%> (ø)
src/frontend/src/observer/observer_manager.rs 0.00% <0.00%> (ø)
src/sqlparser/src/ast/mod.rs 89.47% <0.00%> (+0.11%) ⬆️
src/utils/pgwire/src/pg_response.rs 71.21% <ø> (ø)
src/frontend/src/catalog/schema_catalog.rs 82.25% <84.21%> (+0.35%) ⬆️
src/frontend/src/handler/create_sink.rs 98.83% <98.83%> (ø)
src/frontend/src/catalog/root_catalog.rs 86.54% <100.00%> (+2.19%) ⬆️
src/frontend/src/handler/drop_mv.rs 88.67% <100.00%> (ø)
... and 5 more

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

@@ -34,6 +37,10 @@ pub struct SchemaCatalog {
source_by_name: HashMap<String, SourceCatalog>,
source_name_by_id: HashMap<SourceId, String>,

// TODO(nanderstabel): Can be replaced with a bijective map: https://crates.io/crates/bimap.
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@neverchanje neverchanje marked this pull request as ready for review July 4, 2022 05:25
@@ -84,7 +84,7 @@ pub fn handle_show_object(context: OptimizerContext, command: ShowObject) -> Res
.iter_materialized_source()
.map(|t| t.name.clone())
.collect(),
ShowObject::Sink { _schema } => todo!(),
ShowObject::Sink { schema: _ } => todo!(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Returning an unimplemented error is preferred.

Copy link
Contributor

@neverchanje neverchanje left a comment

Choose a reason for hiding this comment

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

Generally lgtm. Looking forward the meta side impl :)

@neverchanje neverchanje enabled auto-merge (squash) July 4, 2022 05:32
uint32 schema_id = 2;
uint32 database_id = 3;
string name = 4;
string mv_name = 5;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
string mv_name = 5;
uint32 associated_table_id = 5;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for this suggestion, I will implement it in my next PR :)

@neverchanje neverchanje merged commit 06b3c11 into main Jul 4, 2022
@neverchanje neverchanje deleted the ns-sink-frontend branch July 4, 2022 05:43
nasnoisaac pushed a commit to nasnoisaac/risingwave that referenced this pull request Aug 9, 2022
@tabVersion tabVersion added the user-facing-changes Contains changes that are visible to users label Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature user-facing-changes Contains changes that are visible to users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants