jackye1995 commented on a change in pull request #1863:
URL: https://github.com/apache/iceberg/pull/1863#discussion_r534549302



##########
File path: aws/src/main/java/org/apache/iceberg/aws/s3/BaseS3File.java
##########
@@ -77,6 +78,12 @@ public boolean exists() {
 
   protected HeadObjectResponse getObjectMetadata() throws S3Exception {
     if (metadata == null) {
+      // list object to force strong consistency
+      client().listObjectsV2(ListObjectsV2Request.builder()
+          .bucket(uri().bucket())
+          .prefix(uri().key())

Review comment:
       Do we want to validate, or just set metadata to null so that `exists()` 
return false? I understand that it is not likely that a file name is a prefix 
of another file, but we cannot eliminate the possibility of some location 
provider with such behavior.




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