james-rms commented on code in PR #562:
URL: 
https://github.com/apache/arrow-rs-object-store/pull/562#discussion_r2591417854


##########
src/aws/mod.rs:
##########
@@ -305,89 +365,80 @@ impl ObjectStore for AmazonS3 {
         self.client.list_with_delimiter(prefix).await
     }
 
-    async fn copy_opts(&self, from: &Path, to: &Path, options: CopyOptions) -> 
Result<()> {
-        let CopyOptions {
-            mode,
-            extensions: _,
-        } = options;
+    async fn copy(&self, from: &Path, to: &Path) -> Result<()> {
+        // Determine source size to decide between single CopyObject and 
multipart copy
+        let head_meta = self
+            .client
+            .get_opts(
+                from,
+                GetOptions {
+                    head: true,
+                    ..Default::default()
+                },
+            )
+            .await?
+            .meta;

Review Comment:
   The issue with that approach is that on error, AWS does not respond with 
anything more specific than "InvalidRequest": 
   ```
   <Error><Code>InvalidRequest</Code><Message>The specified copy source is 
larger than the maximum allowable size for a copy source: 
5368709120</Message><RequestId>8550KAYYHRYF33SM</RequestId><HostId>R7zaiPWt96z/yQm2PtDT+pyFmYF76YCBcW0AeukdrXpS4qlSuO1nmXTFI4Ak2YcHMsBoymw33j4=</HostId></Error>
   ```
   
   So there's not really a stable API for determining that the request is 
invalid because of the size of the source. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to