felipecrv commented on code in PR #43286:
URL: https://github.com/apache/arrow/pull/43286#discussion_r1681278235


##########
cpp/src/arrow/filesystem/s3fs.cc:
##########
@@ -3072,8 +3078,11 @@ Status S3FileSystem::Move(const std::string& src, const 
std::string& dest) {
   }
   RETURN_NOT_OK(impl_->CopyObject(src_path, dest_path));
   RETURN_NOT_OK(impl_->DeleteObject(src_path.bucket, src_path.key));
-  // Source parent may be implicitly deleted if it became empty, recreate it
-  return impl_->EnsureParentExists(src_path);
+  if (options().create_missing_dirs_on_delete) {
+    // Source parent may be implicitly deleted if it became empty, recreate it
+    return impl_->EnsureParentExists(src_path);
+  }

Review Comment:
   This means that if I start building my filesystem with this option set to 
true and no other way of adding objects to the store, empty directory markers 
will always be created (but only once), and deleting files without re-creating 
the empty directory marker is safe.
   
   If you think that checking that directory marker exists is also too 
expensive on the other operations, there is already an option (the one above 
yours) controlling that. If both are set to true, then we really get that the 
user doesn't care about filesystem semantics at their own peril.



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