plusplusjiajia commented on code in PR #703:
URL: https://github.com/apache/iceberg-cpp/pull/703#discussion_r3371616207


##########
src/iceberg/arrow/arrow_io.cc:
##########
@@ -473,9 +473,14 @@ class ArrowOutputFile : public OutputFile {
 }  // namespace
 
 Result<std::string> ArrowFileSystemFileIO::ResolvePath(const std::string& 
file_location) {
-  if (file_location.find("://") != std::string::npos) {
-    ICEBERG_ARROW_ASSIGN_OR_RETURN(auto path, 
arrow_fs_->PathFromUri(file_location));
-    return path;
+  if (auto pos = file_location.find("://"); pos != std::string::npos) {
+    auto path = arrow_fs_->PathFromUri(file_location);
+    if (path.ok()) {
+      return path.ValueOrDie();
+    }
+    // PathFromUri rejects S3-compatible schemes (s3a/s3n, gs://, oss://);
+    // fall back to the scheme-less bucket/key.
+    return file_location.substr(pos + 3);
   }

Review Comment:
   Addressed: the fallback now triggers only on Arrow's scheme-mismatch error; 
other PathFromUri failures (malformed URI, unsupported authority, …) propagate. 
?query/#fragment are stripped. Added tests for the propagate path and for 
preserving percent-encoded keys.



-- 
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]

Reply via email to