File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -484,14 +484,13 @@ Result<std::string> ArrowFileSystemFileIO::ResolvePath(const std::string& file_l
484484 return std::move (path).ValueOrDie ();
485485 }
486486
487- // Only fall back for Arrow's scheme-mismatch error; propagate anything else.
488- const auto & status = path. status ();
489- if (status. message (). find ( " expected a URI with one of the schemes " ) ==
490- std::string::npos) {
487+ // Foreign alias (s3a/s3n): validate via Arrow's parser, then percent-decode the
488+ // scheme-less key (substring keeps a Windows drive letter's ':' that host() drops).
489+ if (auto parsed = :: arrow::util::Uri::FromString (file_location); !parsed. ok ()) {
490+ const auto & status = parsed. status ();
491491 return std::unexpected<Error>{
492492 {.kind = ToErrorKind (status), .message = status.ToString ()}};
493493 }
494- // Scheme-less bucket/key: drop ?query / #fragment and percent-decode to match s3://.
495494 std::string bucket_key = file_location.substr (pos + 3 );
496495 bucket_key = bucket_key.substr (0 , bucket_key.find_first_of (" ?#" ));
497496 return ::arrow::util::UriUnescape (bucket_key);
You can’t perform that action at this time.
0 commit comments