8000 fix: handle missing 'connector' field in WITH clause with CONNECTION by tabVersion · Pull Request #21691 · risingwavelabs/risingwave · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: handle missing 'connector' field in WITH clause with CONNECTION #21691

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 2 commits into from
May 4, 2025

Conversation

tabVersion
Copy link
Contributor
@tabVersion tabVersion commented May 4, 2025

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

What's changed and what's your intention?

close #21650

The issue is spec to using with CONNECTION, as we will check the compatibility between CONNECTION type and SOURCE/SINK's connector. Not a framework level issue.

Checklist

  • I have written necessary rustdoc comments.
  • I have added necessary unit tests and integration tests.
  • I have added test labels as necessary.
  • I have added fuzzing tests or opened an issue to track them.
  • My PR contains breaking changes.
  • My PR changes performance-critical code, so I will run (micro) benchmarks and present the results.
  • I have checked the Release Timeline and Currently Supported Versions to determine which release branches I need to cherry-pick this PR into.

Documentation

  • My PR needs documentation updates.
Release note

@tabVersion tabVersion requested review from xxchan, kwannoel and Copilot May 4, 2025 11:18
@github-actions github-actions bot added the type/fix Type: Bug fix. Only for pull requests. label May 4, 2025
Copy link
Contributor
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes error handling for missing connector fields in the WITH clause when a connection is used. It replaces unsafe unwrap calls with safe pattern matching in the create_source and create_sink handlers.

  • Replaces unwrap() with a pattern matching block that returns a proper error for a missing connector.
  • Uses distinct keys (UPSTREAM_SOURCE_KEY and CONNECTOR_TYPE_KEY) to provide context-specific error messages.

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
src/frontend/src/handler/create_source.rs Uses pattern matching to safely obtain the connector and returns an error if absent.
src/frontend/src/handler/create_sink.rs Applies similar safe extraction for connector and custom error messaging.
Files not reviewed (1)
  • e2e_test/source_inline/connection/ddl.slt: Language not supported
Comments suppressed due to low confidence (2)

src/frontend/src/handler/create_source.rs:932

  • [nitpick] Verify that using UPSTREAM_SOURCE_KEY in the error message is the intended behavior for source creation, and consider ensuring consistent error code usage with similar handling in other modules.
let Some(connector) = with_properties.get_connector() else {

src/frontend/src/handler/create_sink.rs:140

  • [nitpick] Double-check that the use of CONNECTOR_TYPE_KEY together with ErrorCode::ProtocolError is consistent with the codebase's error handling strategy and aligns with the intended semantics for sink creation.
let Some(connector) = resolved_with_options.get_connector() else {

Copy link
Contributor
@kwannoel kwannoel left a comment

Choose a reason for hiding this comment

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

Thanks!

@tabVersion tabVersion added this pull request to the merge queue May 4, 2025
Merged via the queue into main with commit f837e37 May 4, 2025
28 of 29 checks passed
@tabVersion tabVersion deleted the tab/fix-resolve-connector branch May 4, 2025 12:42
github-actions bot pushed a commit that referenced this pull request May 4, 2025
github-actions bot pushed a commit that referenced this pull request May 4, 2025
github-actions bot pushed a commit that referenced this pull request May 4, 2025
Copy link
Contributor
github-actions bot commented May 4, 2025

✅ Cherry-pick PRs (or issues if encountered conflicts) have been created successfully to all target branches.

github-merge-queue bot pushed a commit that referenced this pull request May 6, 2025
…21691) (#21694)

Co-authored-by: Bohan Zhang <tabvision@bupt.icu>
Co-authored-by: tab <tabversion@bupt.icu>
github-merge-queue bot pushed a commit that referenced this pull request May 6, 2025
…21691) (#21693)

Co-authored-by: Bohan Zhang <tabvision@bupt.icu>
Co-authored-by: tab <tabversion@bupt.icu>
github-merge-queue bot pushed a commit that referenced this pull request May 6, 2025
…21691) (#21692)

Co-authored-by: Bohan Zhang <tabvision@bupt.icu>
Co-authored-by: tab <tabversion@bupt.icu>
Co-authored-by: lmatz <lmatz823@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-cherry-pick-since-release-2.2 type/fix Type: Bug fix. Only for pull requests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed to create Sink connector when connector type not specified
2 participants
0