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(source): create source with connection/drop connection #9128

Merged
merged 44 commits into from
Apr 17, 2023

Conversation

WillyKidd
Copy link
Contributor

@WillyKidd WillyKidd commented Apr 12, 2023

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

What's changed and what's your intention?

  • Moved Connection from root catalog to schema catalog
  • Refined the Create Connection and Show Connections statements according to the changes
  • Implemented the Drop Connection statement
  • Added MockConnection connection type for testing
  • Added some e2e tests for the above features

This is a followup of the last pr: #8907

Related: #8771, #9119

Checklist For Contributors

  • 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 Sqlsmith: Sql feature generation #7934).
  • 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 to the issue)
  • All checks passed in ./risedev check (or alias, ./risedev c)

Checklist For Reviewers

  • I have requested macro/micro-benchmarks as this PR can affect performance substantially, and the results are shown.

Documentation

  • My PR DOES contain user-facing changes.

Types of user-facing changes

  • SQL commands, functions, and operators

Release note

  • Added support for CREATE SOURCE with a privatelink connection. Syntax:
    CREATE SOURCE tcp_metrics (
        device_id VARCHAR,
        metric_name VARCHAR,
        report_time TIMESTAMP,
        metric_value DOUBLE PRECISION
    ) WITH (
        connector = 'kafka',
        topic = 'tcp_metrics',
        scan.startup.mode = 'earliest',
        properties.bootstrap.server = 'b-1.test.ra68za.c10.kafka.us-east-1.amazonaws.com:9092,b-2.test.ra68za.c10.kafka.us-east-1.amazonaws.com:9092',
        connection.name = 'connection_name',
        privatelink.targets = '[{"port": 8001}, {"port": 8002}]',
    ) ROW FORMAT JSON;
  • Added support for DROP CONNECTION. Syntax:
    DROP CONNECTION {{ name }};

@WillyKidd WillyKidd requested a review from StrikeW April 12, 2023 09:55
@github-actions github-actions bot added type/feature user-facing-changes Contains changes that are visible to users labels Apr 12, 2023
@StrikeW StrikeW marked this pull request as draft April 12, 2023 09:57
@WillyKidd WillyKidd marked this pull request as ready for review April 12, 2023 10:51
@WillyKidd WillyKidd marked this pull request as draft April 12, 2023 10:52
@WillyKidd WillyKidd marked this pull request as ready for review April 13, 2023 02:48
@WillyKidd WillyKidd marked this pull request as draft April 13, 2023 02:51
@WillyKidd WillyKidd marked this pull request as ready for review April 13, 2023 03:09
e2e_test/ddl/connection.slt Show resolved Hide resolved
src/meta/src/rpc/service/ddl_service.rs Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Apr 17, 2023

Codecov Report

Merging #9128 (09f9f28) into main (0f37811) will decrease coverage by 0.06%.
The diff coverage is 6.56%.

@@            Coverage Diff             @@
##             main    #9128      +/-   ##
==========================================
- Coverage   70.89%   70.83%   -0.06%     
==========================================
  Files        1203     1201       -2     
  Lines      200839   200992     +153     
==========================================
- Hits       142377   142365      -12     
- Misses      58462    58627     +165     
Flag Coverage Δ
rust 70.83% <6.56%> (-0.06%) ⬇️

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

Impacted Files Coverage Δ
src/ctl/src/cmd_impl/meta/connection.rs 0.00% <0.00%> (ø)
src/ctl/src/lib.rs 0.72% <ø> (+0.06%) ⬆️
src/frontend/src/binder/relation/mod.rs 73.79% <ø> (+0.66%) ⬆️
src/frontend/src/catalog/catalog_service.rs 4.08% <0.00%> (-0.05%) ⬇️
src/frontend/src/catalog/root_catalog.rs 62.10% <0.00%> (-2.40%) ⬇️
src/frontend/src/handler/create_connection.rs 0.00% <0.00%> (ø)
src/frontend/src/handler/drop_connection.rs 0.00% <0.00%> (ø)
src/frontend/src/handler/mod.rs 55.00% <0.00%> (ø)
src/frontend/src/handler/show.rs 45.55% <0.00%> (-0.18%) ⬇️
src/frontend/src/observer/observer_manager.rs 0.00% <0.00%> (ø)
... and 16 more

... and 5 files with indirect coverage changes

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

Copy link
Contributor

@StrikeW StrikeW left a comment

Choose a reason for hiding this comment

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

LGTM

@StrikeW StrikeW requested a review from yezizp2012 April 17, 2023 04:52
@WillyKidd WillyKidd enabled auto-merge April 17, 2023 06:20
Copy link
Member

@yezizp2012 yezizp2012 left a comment

Choose a reason for hiding this comment

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

Rest LGTM.

src/meta/src/manager/catalog/mod.rs Show resolved Hide resolved
@WillyKidd WillyKidd disabled auto-merge April 17, 2023 06:49
@WillyKidd WillyKidd enabled auto-merge April 17, 2023 07:02
@WillyKidd WillyKidd added this pull request to the merge queue Apr 17, 2023
@WillyKidd WillyKidd removed this pull request from the merge queue due to a manual request Apr 17, 2023
@WillyKidd WillyKidd added this pull request to the merge queue Apr 17, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 17, 2023
@WillyKidd WillyKidd added this pull request to the merge queue Apr 17, 2023
Merged via the queue into main with commit a4b67cd Apr 17, 2023
@WillyKidd WillyKidd deleted the weili/connection-in-schema branch April 17, 2023 08:24
@hengm3467 hengm3467 added the 📖✓ Covered or will be covered in the user docs. label Apr 26, 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 📖✓ Covered or will be covered in the user docs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants