-
Notifications
You must be signed in to change notification settings - Fork 14
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
Don't pick up S3 config file/env props automatically #763
Conversation
pub fn s3_opts_to_file_io_props( | ||
key: AmazonS3ConfigKey, | ||
val: &str, | ||
props: &mut HashMap<String, String>, |
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.
You can declare this HashMap inside the function and just return it. It makes the signature and caller simpler.
And AFAIK, with rust, there is neither a copy nor a heap allocation involved when returning large structures
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.
s3_opts_to_file_io_props
processes a single key at a time, so I can't really return the entire map from it (i.e. it needs to "hydrate" an existing one).
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.
Ahh, ok. I didn't see the loop in the caller
object_store_factory/src/utils.rs
Outdated
props.insert(S3_ALLOW_ANONYMOUS.to_string(), val.clone()); | ||
props.insert(S3_DISABLE_EC2_METADATA.to_string(), val.clone()); | ||
continue; | ||
match AmazonS3ConfigKey::from_str(key) { |
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.
Lets move this function to lib.rs
and delete this file.
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.
Makes sense, done.
…ons are passed in
Do this by automatically setting the new
S3_DISABLE_CONFIG_LOAD
config var to true when any S3 options are passed in.Also bump iceberg to pick up some type conversion/stats parsing fixes.