-
Notifications
You must be signed in to change notification settings - Fork 591
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
refactor(source): refactor s3 source WITH
options handling
#14190
refactor(source): refactor s3 source WITH
options handling
#14190
Conversation
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
Wait, it seems this is also failing on main... |
c33129f
to
64b9ed0
Compare
d6e8b64
to
1ff6db4
Compare
WITH
options handling
Hmm... I also find that currently both s3 and s3_v2 can not work, and can be reproduced locally. I suspect it's a bug introduced by some recent PRs, any ideas? cc @tabVersion |
71d2b0f
to
ecba13b
Compare
suspect #13707 breaks s3 or parser parts, may suspend the pr and wait for @Rossil2012 find out why. |
It seems we can't land #13654 in 1.6 |
ecba13b
to
e44b49f
Compare
s3 source tests passed @tabVersion |
match connector.as_str() { | ||
"s3_v2" => { | ||
let assume_role = with_properties.get("s3.assume_role").cloned(); | ||
return Ok(ConnectorProperties::OpendalS3(Box::new( | ||
OpendalS3Properties { | ||
s3_properties: S3Properties::try_from_hashmap(with_properties)?, | ||
assume_role, | ||
}, | ||
))); | ||
} | ||
"gcs" => { | ||
return Ok(ConnectorProperties::Gcs(Box::new( | ||
GcsProperties::try_from_hashmap(with_properties)?, | ||
))); | ||
} |
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.
where's the dispatch logic going
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.
... Do you remember why the dispatch is needed 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.
IIUC, previously we need the if here because s3_v2 and s3 shares the same config struct, and thus the macro cannot dispatch correctly. Since we have separated types now, the special treatment seems unnecessary and confusing.
I mentioned in the PR description
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.
match_source_name_str
takes care of all cases, which I think goes to this in the lowest level
risingwave/src/connector/src/macros.rs
Lines 35 to 37 in 4695ad1
{ S3, $crate::source::filesystem::S3Properties, $crate::source::filesystem::FsSplit }, | |
{ Gcs, $crate::source::filesystem::opendal_source::GcsProperties , $crate::source::filesystem::OpendalFsSplit<$crate::source::filesystem::opendal_source::OpendalGcs> }, | |
{ OpendalS3, $crate::source::filesystem::opendal_source::OpendalS3Properties, $crate::source::filesystem::OpendalFsSplit<$crate::source::filesystem::opendal_source::OpendalS3> }, |
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.
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 for helping me remember the structure. No more question.
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?
remove the
if
inextract
IIUC, previously we need the
if
here becauses3_v2
ands3
shares the same config struct, and thus the macro cannot dispatch correctly. Since we have separated types now, the special treatment seems unnecessary and confusing.Share a
S3PropertiesCommon
, instead of the top-levelS3Properties
. This corresponds to the pattern described in feat(source): deny unknown fields forWITH
options #13654 (comment) . (We need to addunknown_fields
in both the top-level structs later..)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.