dataroaring commented on code in PR #43525:
URL: https://github.com/apache/doris/pull/43525#discussion_r1845272669


##########
be/src/io/file_factory.cpp:
##########
@@ -147,8 +147,12 @@ Result<io::FileReaderSPtr> FileFactory::create_file_reader(
     switch (type) {
     case TFileType::FILE_LOCAL: {
         io::FileReaderSPtr file_reader;
-        RETURN_IF_ERROR_RESULT(io::global_local_filesystem()->open_file(
-                file_description.path, &file_reader, &reader_options));
+        std::string final_file = file_description.path;
+        if (final_file.rfind("file:", 0) == 0) { // Check if 'str' starts with 
'prefix'
+            final_file = final_file.substr(5);
+        }
+        
RETURN_IF_ERROR_RESULT(io::global_local_filesystem()->open_file(final_file, 
&file_reader,
+                                                                        
&reader_options));

Review Comment:
   file:: prefix is duplicated with type? Maybe we should parse when get type 
and check if they are same.



-- 
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: commits-unsubscr...@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to