zhjwpku commented on code in PR #818:
URL: https://github.com/apache/iceberg-cpp/pull/818#discussion_r3527527708
##########
src/iceberg/arrow/arrow_io.cc:
##########
@@ -484,24 +485,52 @@ class ArrowOutputFile : public OutputFile {
} // namespace
Result<std::string> ArrowFileSystemFileIO::ResolvePath(const std::string&
file_location) {
- const auto pos = file_location.find("://");
- if (pos == std::string::npos) {
- return file_location;
+ // Detect whether the location is a URI by looking for a scheme component.
+ // See iceberg/util/uri.h for the RFC 3986 scheme grammar.
+ bool is_uri = IsUriScheme(file_location);
+
+ if (!is_uri) {
+ return file_location; // Bare local path (Unix or Windows drive letter)
+ }
+
+ auto colon_pos = file_location.find(':');
Review Comment:
Now we have two calls to `find`. That's probably acceptable, but we could
also add an output parameter to return `colon_pos`. Not a strong opinion.
--
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]