bkietz commented on code in PR #41559:
URL: https://github.com/apache/arrow/pull/41559#discussion_r2029652585
##########
cpp/src/arrow/filesystem/s3fs.cc:
##########
@@ -3082,6 +3085,30 @@ Result<std::string> S3FileSystem::PathFromUri(const
std::string& uri_string) con
internal::AuthorityHandlingBehavior::kPrepend);
}
+Result<std::string> S3FileSystem::MakeUri(std::string path) const {
+ if (path.length() <= 1 || path[0] != '/') {
+ return Status::Invalid("MakeUri requires an absolute, non-root path, got
", path);
+ }
+ ARROW_ASSIGN_OR_RAISE(auto uri, util::UriFromAbsolutePath(path));
+ if (!options().GetAccessKey().empty()) {
+ uri = "s3://" + options().GetAccessKey() + ":" + options().GetSecretKey()
+ "@" +
+ uri.substr("file:///"s.size());
+ } else {
+ uri = "s3" + uri.substr("file"s.size());
+ }
+ uri += "?";
+ uri += "region=" + util::UriEscape(options().region);
+ uri += "&";
+ uri += "scheme=" + options().scheme;
Review Comment:
thanks; when I omitted this I was thinking that the uri scheme was always a
small identifier but I suppose "slow+s3" is a valid scheme too
--
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]