rdblue commented on pull request #1863:
URL: https://github.com/apache/iceberg/pull/1863#issuecomment-737484633


   It looks like it should be possible to use just a LIST call here because we 
don't need the full metadata from the HEAD request. Metadata is only used for 
the existence check and for the file size, which should be available from the 
list response:
   
   ```java
         // list object to force strong consistency
         ListObjectsV2Response response = 
client().listObjectsV2(ListObjectsV2Request.builder()
             .bucket(uri().bucket())
             .prefix(uri().key())
             .build());
   
         Preconditions.checkState(response.contents().size() <= 1, "Invalid 
file: %s contains more than one object", uri);
         this.exists = response.contents().size() > 0;
         this.length = response.contents().get(0).size();
   ```


----------------------------------------------------------------
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to