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


##########
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:
   Is my understanding correct?
   
   Currently, when attempting to delete a directory, it does not check for the 
presence of other files within the directory but instead creates a marker.
   
   Are you suggesting these improvements?
   
   - When a specific directory is being deleted, it is necessary to check for 
the existence of the parent directory:
     - If there are no files in the parent directory and no marker exists, then 
create a marker.
     - If there are files in the parent directory, do not create a marker.
   - When a specific file is being deleted, it is necessary to check for the 
presence of other files within the directory:
     - If other files exist, do not create a marker.
     - If no other files exist, create a marker.
   



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