github-actions[bot] commented on code in PR #43525:
URL: https://github.com/apache/doris/pull/43525#discussion_r1848239489
##########
be/src/io/fs/local_file_system.cpp:
##########
@@ -471,4 +471,46 @@ Status LocalFileSystem::permission_impl(const Path& file,
std::filesystem::perms
return Status::OK();
}
+Status LocalFileSystem::convert_to_abs_path(const Path& input_path_str, Path&
abs_path) {
+ // valid path include:
+ // 1. abc/def while return abc/def
+ // 2. /abc/def while return /abc/def
+ // 3. file:/abc/def while return /abc/def
+ // 4. file://<authority>/abc/def while return /abc/def
+ std::string path_str = input_path_str;
+ size_t slash = path_str.find('/');
+ if (slash == 0) {
+ abs_path = input_path_str;
+ return Status::OK();
+ }
+
+ // Initialize scheme and authority
+ std::string scheme;
+ size_t start = 0;
+
+ // Parse URI scheme
+ size_t colon = path_str.find(':');
+ if (colon != std::string::npos && (slash == std::string::npos || colon <
slash)) {
+ // Has a scheme
+ scheme = path_str.substr(0, colon);
+ if (scheme != "file") {
Review Comment:
warning: do not use 'compare' to test equality of strings; use the string
equality operator instead [readability-string-compare]
```suggestion
if (scheme != "file") {
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]