plusplusjiajia commented on code in PR #719:
URL: https://github.com/apache/iceberg-cpp/pull/719#discussion_r3458108440
##########
src/iceberg/catalog/rest/rest_file_io.cc:
##########
@@ -92,4 +95,30 @@ Result<std::unique_ptr<FileIO>> MakeCatalogFileIO(const
RestCatalogProperties& c
return FileIORegistry::Load(io_impl, config.configs());
}
+const StorageCredential* SelectS3StorageCredential(
+ const std::vector<StorageCredential>& credentials) {
+ const StorageCredential* best = nullptr;
+ for (const auto& cred : credentials) {
+ if (cred.prefix.starts_with("s3") &&
Review Comment:
@wgtmac Good catch. Fixed: SelectS3StorageCredential now picks the longest
credential prefix that is actually a prefix of the table's storage location
(passed down from metadata->location), instead of the longest s3 prefix
globally — matching the REST spec / Java S3FileIO. It also treats s3/s3a/s3n as
equivalent so an s3:// vended prefix still matches an s3a:// location.
--
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]