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


##########
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:
   For symmetry, when checking if a directory exists, don't consider objects 
with a `dir/` prefix in the path other than the empty directory marker itself 
as a sign that the directory exists.



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