This is an automated email from the ASF dual-hosted git repository.
tustvold pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
The following commit(s) were added to refs/heads/master by this push:
new e8c6d95191e Fix handling of empty multipart uploads for GCS (#5590)
e8c6d95191e is described below
commit e8c6d95191e6ac62ce78e827b4df1edf3ba8c591
Author: Raphael Taylor-Davies <[email protected]>
AuthorDate: Sat Apr 6 07:07:50 2024 +0100
Fix handling of empty multipart uploads for GCS (#5590)
* Fix handling of empty multipart uploads for GCS
* Clippy
---
object_store/src/gcp/client.rs | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/object_store/src/gcp/client.rs b/object_store/src/gcp/client.rs
index 901257f917c..3762915b0b0 100644
--- a/object_store/src/gcp/client.rs
+++ b/object_store/src/gcp/client.rs
@@ -430,6 +430,13 @@ impl GoogleCloudStorageClient {
multipart_id: &MultipartId,
completed_parts: Vec<PartId>,
) -> Result<PutResult> {
+ if completed_parts.is_empty() {
+ // GCS doesn't allow empty multipart uploads
+ let result = self.put_request(path,
Default::default()).send().await?;
+ self.multipart_cleanup(path, multipart_id).await?;
+ return Ok(result);
+ }
+
let upload_id = multipart_id.clone();
let url = self.object_url(path);