Add put_multipart_opts (#5435)#5652
Merged
tustvold merged 5 commits intoapache:masterfrom Apr 17, 2024
Merged
Conversation
tustvold
commented
Apr 16, 2024
Comment on lines
+337
to
+338
| .with_attributes(opts.attributes) | ||
| .with_tags(opts.tags) |
Contributor
Author
There was a problem hiding this comment.
Unlike AWS (and GCP which copies AWS) the tags and attributes are specified in the completion request that assembles the object
tustvold
commented
Apr 16, 2024
Comment on lines
-365
to
-380
| let mut has_content_type = false; | ||
| for (k, v) in &attributes { | ||
| builder = match k { | ||
| Attribute::CacheControl => builder.header(CACHE_CONTROL, v.as_ref()), | ||
| Attribute::ContentType => { | ||
| has_content_type = true; | ||
| builder.header(CONTENT_TYPE, v.as_ref()) | ||
| } | ||
| }; | ||
| } | ||
|
|
||
| if !has_content_type { | ||
| if let Some(value) = self.config.client_options.get_content_type(path) { | ||
| builder = builder.header(CONTENT_TYPE, value); | ||
| } | ||
| } |
Contributor
Author
There was a problem hiding this comment.
Previously we were specifying these for put_part uploads which is technically not correct (although appears to be harmless)
tustvold
commented
Apr 16, 2024
| idempotent: false, | ||
| } | ||
| self.request(Method::PUT, to) | ||
| .idempotent(true) |
Contributor
Author
There was a problem hiding this comment.
CopyObject is idempotent
tustvold
commented
Apr 16, 2024
| let etag = self.storage.write().insert( | ||
| &self.location, | ||
| buf.into(), | ||
| std::mem::take(&mut self.attributes), |
Contributor
Author
There was a problem hiding this comment.
Calling complete multiple times is documented as implementation defined behaviour so this is fine
Xuanwo
reviewed
Apr 16, 2024
260b7fe to
7f482d8
Compare
crepererum
approved these changes
Apr 17, 2024
alamb
pushed a commit
to alamb/arrow-rs
that referenced
this pull request
Mar 20, 2025
* Add put_multipart_opts (apache#5435)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #5435
Rationale for this change
This allows setting tags and attributes for multipart uploads
What changes are included in this PR?
Are there any user-facing changes?