8000 feat(source): Use a private link connection to create Kafka source by StrikeW · Pull Request #9119 · risingwavelabs/risingwave · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(source): Use a private link connection to create Kafka source #9119

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 11 commits into from
Apr 14, 2023

Conversation

StrikeW
Copy link
Contributor
@StrikeW StrikeW 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?

  • Support new syntax to create a Kafka source with the private link.
CREATE CONNECTION my_connection with (
    type = 'privatelink',
    provider = 'aws',
    service.name = 'xxx'
);

CREATE SOURCE tcp_metrics_rw (
    device_id VARCHAR,
    metric_name VARCHAR,
    report_time TIMESTAMP,
    metric_value DOUBLE PRECISION
) WITH (
  connector = 'kafka',
  topic = 'tcp_metrics',
  properties.bootstrap.server = 'ip1:9092,ip2:9092',
  connection.name = 'my_connection',
  privatelink.targets = '[{"port": 8001}, {"port": 8002}]',
  scan.startup.mode = 'earliest'
) ROW FORMAT JSON;

#8771

Checklist For Contributo 8000 rs

  • 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

Click here for Documentation

Types of user-facing changes

Please keep the types that apply to your changes, and remove the others.

  • Connector (sources & sinks)
  • SQL commands, functions, and operators

Release note

  • Add a new SQL command CREATE CONNECTION that allow users to create a privatelink connection in the cloud
  • Support using a privatelink connection to create a Kafka source in the CREATE SOURCE SQL command

@github-actions github-actions bot added the type/feature Type: New feature. label Apr 12, 2023
@StrikeW StrikeW changed the title feat(private-link): Use a private connection to create Kafka source feat(private-link): Use a private link connection to create Kafka source Apr 12, 2023
@WillyKidd
Copy link
Contributor

LGTM :)

@StrikeW StrikeW requested a review from hzxa21 April 12, 2023 09:25
@StrikeW StrikeW changed the title feat(private-link): Use a private link connection to create Kafka source feat(source): Use a private link connection to create Kafka source Apr 12, 2023
@StrikeW StrikeW added the user-facing-changes Contains changes that are visible to users label Apr 12, 2023
@github-actions github-actions bot removed the user-facing-changes Contains changes that are visible to users label Apr 12, 2023
Copy link
Collaborator
@fuyufjh fuyufjh left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -688,45 +689,57 @@ where
.get(kafka_props_broker_key(properties))
.cloned()
.ok_or(MetaError::from(anyhow!(
"Must specify brokers in WITH clause",
"Must specify brokers property in WITH clause",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"Must specify brokers property in WITH clause",
"Must specify \"properties.bootstrap.server\" in WITH clause",

By the way, why is there a properties.? Looks redundant..

Copy link
Contributor Author
@StrikeW StrikeW Apr 13, 2023

Choose a reason for hiding this comment

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

Fixed. Hmm, I have no idea. It has been there for a long time. cc @tabVersion

Copy link
Contributor

Choose a reason for hiding this comment

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

it is following Flink's naming style

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, please add user-facing-changes label for it and provide more details in the Documentation section.

@StrikeW StrikeW added the user-facing-changes Contains changes that are visible to users label Apr 13, 2023
@github-actions github-actions bot removed the user-facing-changes Contains changes that are visible to users label Apr 13, 2023
@StrikeW StrikeW requested a review from yezizp2012 April 13, 2023 11:09
@StrikeW StrikeW added the user-facing-changes Contains changes that are visible to users label Apr 13, 2023
@github-actions github-actions bot removed the user-facing-changes Contains changes that are visible to users label Apr 13, 2023
@StrikeW StrikeW added the user-facing-changes Contains changes that are visible to users label Apr 13, 2023
@codecov
Copy link
codecov bot commented Apr 13, 2023

Codecov Report

Merging #9119 (1851780) into main (95ab15c) will decrease coverage by 0.04%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #9119      +/-   ##
==========================================
- Coverage   70.76%   70.73%   -0.04%     
==========================================
  Files        1195     1195              
  Lines      197607   197673      +66     
==========================================
- Hits       139834   139818      -16     
- Misses      57773    57855      +82     
Flag Coverage Δ
rust 70.73% <0.00%> (-0.04%) ⬇️

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

Impacted Files Coverage Δ
src/connector/src/common.rs 3.07% <ø> (+0.04%) ⬆️
src/ctl/src/cmd_impl/meta/connection.rs 0.00% <ø> (ø)
src/ctl/src/lib.rs 0.66% <0.00%> (+0.02%) ⬆️
src/frontend/src/handler/create_connection.rs 0.00% <ø> (ø)
src/meta/src/rpc/cloud_provider.rs 0.00% <0.00%> (ø)
src/meta/src/rpc/service/ddl_service.rs 0.00% <0.00%> (ø)

... and 6 files with indirect coverage changes

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

@hzxa21
Copy link
Collaborator
hzxa21 commented Apr 13, 2023
privatelink.targets = '[{"port": 8001}, {"port": 8002}]'

Why do we use json format here if only port is provided? This seems inconsistent with the format of other properties. Can we just provide something like "8001, 8002" here.

Copy link
Contributor
@tabVersion tabVersion left a comment

Choose a reason for hiding this comment

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

LGTM, good work

@StrikeW
Copy link
Contributor Author
StrikeW commented Apr 14, 2023

privatelink.targets = '[{"port": 8001}, {"port": 8002}]'

Why do we use json format here if only port is provided? This seems inconsistent with the format of other properties. Can we just provide something like "8001, 8002" here.

The cloud team doesn't have a final conclusion about the availability zone issue. Use a Json here reserves the flexibility to add more args for the target in the future. cc @mikechesterwang

@StrikeW StrikeW enabled auto-merge April 14, 2023 07:21
@StrikeW StrikeW added this pull request to the merge queue Apr 14, 2023
Merged via the queue into main with commit a2fe5aa Apr 14, 2023
@StrikeW StrikeW deleted the siyuan/private-link branch April 14, 2023 07:59
@CharlieSYH CharlieSYH added the 📖✓ Covered or will be covered in the user docs. label Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment 87DC
Labels
experimental type/feature Type: New 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.

7 participants
0