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): Add Create subscription in frontend #14831

Merged
merged 23 commits into from
Mar 20, 2024

Conversation

xxhZs
Copy link
Contributor

@xxhZs xxhZs commented Jan 29, 2024

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

What's changed and what's your intention?

In this pr,

We added subscription to the rw_subscriptions rw_relation and rw_relation_info.
We support the parse, build_plan and execution of the statements

CREATE SUBSCRIPTION s1 FROM aaa WITH (retention = '1D') ;
DROP SUBSCRIPTION xxx;
ALTER SUBSCRIPTION x1 RENAME TO x2 ;
ALTER SUBSCRIPTION x1 OWNER TO user1;
ALTER SUBSCRIPTION x1 SET SCHEMA test_schema;
ALTER SUBSCRIPTION x1 SET PARALLELISM = 4;
SHOW SUBSCRIPTIONS;
SHOW CREATE SUBSCRIPTION subscription1;

And in this pr, We have only added tests for SUBSCRIPTION ddl, the specific result tests will be added in the next pr

related #14316

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added test labels as necessary. See details.
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

Copy link
Contributor

@github-actions github-actions bot left a comment

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 4757 files.

Valid Invalid Ignored Fixed
2067 1 2689 0
Click to see the invalid file list
  • src/frontend/src/optimizer/mod.rs

src/frontend/src/optimizer/mod.rs Outdated Show resolved Hide resolved
fix
@xxhZs xxhZs force-pushed the xxh/create-subsciption-frontend branch from e672c82 to 8d31998 Compare January 30, 2024 04:04
@TennyZhuang TennyZhuang self-requested a review February 18, 2024 12:22
@xxhZs xxhZs mentioned this pull request Feb 21, 2024
9 tasks
Copy link

gitguardian bot commented Feb 26, 2024

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
9425213 Triggered Generic Password eacebbe ci/scripts/regress-test.sh View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

Copy link
Collaborator

@hzxa21 hzxa21 left a comment

Choose a reason for hiding this comment

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

I am a bit concerned with a 2.3K LoC PR with zero test :(

Is it possible to split it into smaller PRs and add some tests (at least e2e tests).

proto/catalog.proto Outdated Show resolved Hide resolved
@@ -727,6 +720,12 @@ message OverWindowNode {
OverWindowCachePolicy cache_policy = 5;
}

message SubscriptionNode {
catalog.Subscription subscription_catalog = 1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just to confirm: the breaking changes here are acceptable because Subscription feature is not released and no one is using it, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yesyes

src/frontend/src/handler/mod.rs Show resolved Hide resolved
src/frontend/src/observer/observer_manager.rs Outdated Show resolved Hide resolved
@hzxa21 hzxa21 requested a review from wenym1 February 28, 2024 04:15
add ci
@xxhZs xxhZs force-pushed the xxh/create-subsciption-frontend branch 2 times, most recently from e5ef12b to 1237d9f Compare February 28, 2024 11:35
fix ci

fix ci

fix
@xxhZs xxhZs force-pushed the xxh/create-subsciption-frontend branch from 1237d9f to 4aadbd2 Compare February 29, 2024 03:04
@xxhZs xxhZs force-pushed the xxh/create-subsciption-frontend branch from 401fb64 to b0bc196 Compare February 29, 2024 05:18
@xxhZs xxhZs requested a review from hzxa21 February 29, 2024 06:53
@wenym1
Copy link
Contributor

wenym1 commented Mar 5, 2024

Left a comment in the previous PR. Might be fixed by the way in this PR.
#15371 (comment)

fix ddl controller
@xxhZs xxhZs force-pushed the xxh/create-subsciption-frontend branch from 81672d8 to 6dd8d88 Compare March 5, 2024 06:52
Copy link
Collaborator

@hzxa21 hzxa21 left a comment

Choose a reason for hiding this comment

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

LGTM. Please wait for other reviewers' review who are more familiar with optimizer/parser before merging.

src/frontend/src/optimizer/plan_node/stream_sink.rs Outdated Show resolved Hide resolved
@xxhZs xxhZs requested a review from chenzl25 March 8, 2024 09:00
@xxhZs xxhZs requested a review from st1page March 11, 2024 06:37
@tabVersion tabVersion self-requested a review March 11, 2024 10:14
Copy link
Contributor

@chenzl25 chenzl25 left a comment

Choose a reason for hiding this comment

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

Could you please test drop cascade for a table if it is used by a subscription?

create table t (..);
create subscription sub from t;
drop table t cascade;

@xxhZs
Copy link
Contributor Author

xxhZs commented Mar 19, 2024

Could you please test drop cascade for a table if it is used by a subscription?

create table t (..);
create subscription sub from t;
drop table t cascade;

test it, drop table t cascade; will drop sub;

Copy link
Contributor

@chenzl25 chenzl25 left a comment

Choose a reason for hiding this comment

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

LGTM!

@chenzl25
Copy link
Contributor

Could you please test drop cascade for a table if it is used by a subscription?

create table t (..);
create subscription sub from t;
drop table t cascade;

test it, drop table t cascade; will drop sub;

I see, no wonder I couldn't find the relevant code in this PR, because it is supported in a previous PR.

@xxhZs xxhZs enabled auto-merge March 19, 2024 09:58
@xxhZs xxhZs added this pull request to the merge queue Mar 20, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 20, 2024
@xxhZs xxhZs added this pull request to the merge queue Mar 20, 2024
Merged via the queue into main with commit 34d31aa Mar 20, 2024
26 of 29 checks passed
@xxhZs xxhZs deleted the xxh/create-subsciption-frontend branch March 20, 2024 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants