ArianaVillegas commented on code in PR #12625:
URL: https://github.com/apache/arrow/pull/12625#discussion_r864843795
##########
cpp/src/arrow/engine/substrait/relation_internal.cc:
##########
@@ -49,6 +50,52 @@ Status CheckRelCommon(const RelMessage& rel) {
return Status::OK();
}
+Result<fs::FileInfoVector> GetGlobFiles(const std::shared_ptr<fs::FileSystem>&
filesystem,
+ const std::string& glob) {
+ fs::FileInfoVector results, temp;
+ fs::FileSelector selector;
+ std::string cur;
+
+ auto split_path = fs::internal::SplitAbstractPath(glob, '/');
+ ARROW_ASSIGN_OR_RAISE(auto file, filesystem->GetFileInfo("/"));
+ results.push_back(std::move(file));
+
+ for (size_t i = 0; i < split_path.size(); i++) {
+ if (split_path[i].find_first_of("*?") == std::string::npos) {
+ if (cur.empty())
+ cur = split_path[i];
+ else
+ cur = fs::internal::ConcatAbstractPath(cur, split_path[i]);
+ continue;
+ } else {
+ for (auto res : results) {
+ if (res.type() != fs::FileType::Directory) continue;
+ selector.base_dir = res.path() + cur;
+ ARROW_ASSIGN_OR_RAISE(auto entries, filesystem->GetFileInfo(selector));
Review Comment:
https://issues.apache.org/jira/browse/ARROW-16459
--
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]