-
Notifications
You must be signed in to change notification settings - Fork 647
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
Conversation
… and create sink statements
There was a problem hiding this 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 {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
…21691) Co-authored-by: tab <tabversion@bupt.icu>
…21691) Co-authored-by: tab <tabversion@bupt.icu>
…21691) Co-authored-by: tab <tabversion@bupt.icu>
✅ Cherry-pick PRs (or issues if encountered conflicts) have been created successfully to all target branches. |
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
Documentation
Release note