plusplusjiajia commented on code in PR #893:
URL: https://github.com/apache/iceberg-cpp/pull/893#discussion_r3855361343
##########
src/iceberg/arrow/s3/arrow_s3_file_io.cc:
##########
@@ -177,10 +177,17 @@ Result<std::shared_ptr<::arrow::fs::FileSystem>>
BuildArrowS3FileSystem(
return std::shared_ptr<::arrow::fs::FileSystem>(std::move(fs));
}
+// Rewrites a foreign alias to `s3://` so locations and credential prefixes
+// compare equal. Derived from kS3Schemes: an alias missing here would not
+// fail, it would silently stop matching its credential.
std::string CanonicalizeS3Scheme(std::string_view location) {
- for (std::string_view scheme : {"s3a://", "s3n://"}) {
- if (location.starts_with(scheme)) {
- return std::string("s3://").append(location.substr(scheme.size()));
+ for (std::string_view scheme : kS3Schemes) {
+ if (scheme == S3Properties::kS3Schema) {
+ continue;
+ }
+ if (location.starts_with(scheme) &&
Review Comment:
@wgtmac Fixed — matching is now case-insensitive for URI-form schemes
(centralized next to kS3Schemes), with `OSS://` in the test matrix.
--
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]