You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/04/25 13:19:45 UTC

[GitHub] [arrow] lidavidm commented on a diff in pull request #12977: ARROW-16302: [C++] Null values in partitioning field for FilenamePartitioning

lidavidm commented on code in PR #12977:
URL: https://github.com/apache/arrow/pull/12977#discussion_r857616730


##########
cpp/src/arrow/dataset/discovery.cc:
##########
@@ -278,8 +278,13 @@ Result<std::shared_ptr<Dataset>> FileSystemDatasetFactory::Finish(FinishOptions
   }
 
   std::vector<std::shared_ptr<FileFragment>> fragments;
+  std::string fixed_path;
   for (const auto& info : files_) {
-    auto fixed_path = StripPrefixAndFilename(info.path(), options_.partition_base_dir);
+    if (partitioning->type_name() == "filename") {
+      fixed_path = StripPrefix(info.path(), options_.partition_base_dir);
+    } else {
+      fixed_path = StripPrefixAndFilename(info.path(), options_.partition_base_dir);
+    }

Review Comment:
   I wonder if we should make it the responsibility of the partitioning implementation to strip the filename, instead of hardcoding an exception. (After all, what if the user wants to define a custom filename-based partitioning scheme?) Or we could pass both the path and the filename separately to `partitioning->Parse`.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org