kou commented on code in PR #40567:
URL: https://github.com/apache/arrow/pull/40567#discussion_r1542317802
##########
cpp/src/arrow/filesystem/azurefs.cc:
##########
@@ -1803,37 +1805,63 @@ class AzureFileSystem::Impl {
const AzureLocation& location, bool recursive) {
DCHECK(!location.container.empty());
DCHECK(!location.path.empty());
- // Non-recursive CreateDir calls require the parent directory to exist.
- if (!recursive) {
+ if (recursive) {
+ std::vector<AzureLocation> target_locations;
+ // Recursive CreateDir calls require there is no file in parents.
Review Comment:
Thanks! Applied!
##########
cpp/src/arrow/filesystem/azurefs.cc:
##########
@@ -1803,37 +1805,63 @@ class AzureFileSystem::Impl {
const AzureLocation& location, bool recursive) {
DCHECK(!location.container.empty());
DCHECK(!location.path.empty());
- // Non-recursive CreateDir calls require the parent directory to exist.
- if (!recursive) {
+ if (recursive) {
+ std::vector<AzureLocation> target_locations;
+ // Recursive CreateDir calls require there is no file in parents.
+ auto parent = location;
+ while (!parent.path.empty()) {
+ ARROW_ASSIGN_OR_RAISE(auto info, GetFileInfo(container_client,
parent));
+ if (info.type() == FileType::File) {
+ return NotADir(parent);
+ }
+ if (info.type() == FileType::NotFound) {
+ target_locations.push_back(parent);
+ }
+ parent = parent.parent();
Review Comment:
OK. I've changed it to `prefix`.
--
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]