ArianaVillegas commented on code in PR #12625:
URL: https://github.com/apache/arrow/pull/12625#discussion_r862248137


##########
cpp/src/arrow/engine/substrait/relation_internal.cc:
##########
@@ -88,35 +142,41 @@ Result<compute::Declaration> FromProto(const 
substrait::Rel& rel,
 
       std::shared_ptr<dataset::FileFormat> format;
       auto filesystem = std::make_shared<fs::LocalFileSystem>();
-      std::vector<std::shared_ptr<dataset::FileFragment>> fragments;
+      std::vector<fs::FileInfo> files;
 
       for (const auto& item : read.local_files().items()) {
-        if (item.path_type_case() !=
-            substrait::ReadRel_LocalFiles_FileOrFiles::kUriFile) {
-          return Status::NotImplemented(
-              "substrait::ReadRel::LocalFiles::FileOrFiles with "
-              "path_type other than uri_file");
+        std::string path;
+        if (item.path_type_case() ==
+            substrait::ReadRel_LocalFiles_FileOrFiles::kUriPath) {
+          path = item.uri_path();
+        } else if (item.path_type_case() ==
+                   substrait::ReadRel_LocalFiles_FileOrFiles::kUriFile) {
+          path = item.uri_file();
+        } else if (item.path_type_case() ==
+                   substrait::ReadRel_LocalFiles_FileOrFiles::kUriFolder) {
+          path = item.uri_folder();
+        } else {
+          path = item.uri_path_glob();
         }
 
         if (item.format() ==
             substrait::ReadRel::LocalFiles::FileOrFiles::FILE_FORMAT_PARQUET) {
           format = std::make_shared<dataset::ParquetFileFormat>();
-        } else if (util::string_view{item.uri_file()}.ends_with(".arrow")) {
+        } else if (util::string_view{path}.ends_with(".arrow")) {
           format = std::make_shared<dataset::IpcFileFormat>();
-        } else if (util::string_view{item.uri_file()}.ends_with(".feather")) {
+        } else if (util::string_view{path}.ends_with(".feather")) {
           format = std::make_shared<dataset::IpcFileFormat>();
         } else {
           return Status::NotImplemented(
               "substrait::ReadRel::LocalFiles::FileOrFiles::format "
               "other than FILE_FORMAT_PARQUET");
         }
 
-        if (!util::string_view{item.uri_file()}.starts_with("file:///")) {
+        if (!util::string_view{path}.starts_with("file:///")) {

Review Comment:
   https://issues.apache.org/jira/browse/ARROW-16424



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