-
Notifications
You must be signed in to change notification settings - Fork 599
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(cdc): support default column in auto schema mapping #18571
Conversation
src/connector/src/error.rs
Outdated
@@ -42,6 +42,7 @@ def_anyhow_newtype! { | |||
url::ParseError => "failed to parse url", | |||
serde_json::Error => "failed to parse json", | |||
csv::Error => "failed to parse csv", | |||
rust_decimal::Error => transparent, |
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.
I think some context must be attached when converting a rust_decimal::Error
to ConnectorError
. If it's the case, could you remove the line here and explicitly call .context()
on the result?
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.
fixed
_ => { | ||
unreachable!("unexpected default value type for integer column") | ||
} |
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.
Since the default
and data_type
are from external systems, shall we return an error instead of panicking here?
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.
sounds ok to me.
unreachable!("unexpected default value type for float column") | ||
} | ||
}, | ||
ColumnDefault::String(val) | ColumnDefault::CustomExpr(val) => { |
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.
Why do we involve CustomExpr
here?
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.
refactored. CustomExpr
cannot be supported right now.
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.
Rest LGTM
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
support default column in auto schema mapping for mysql and postgres.
The implementation only support constant expression, if the default value cannot be parsed it will be ignored.
close #18359
Checklist
./risedev check
(or alias,./risedev c
)Documentation
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.