[R] read_parquet shows misleading message about url scheme when reading from s3 failed
- Dominant language
- C++
- Stars
- 17.1k
- Forks
- 4.3k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 91
Description
When reading from s3 failed, the error message user get is
> Error in url(file, open = "rb") : URL scheme unsupported by this method
The reason is in arrow:::make_readable_file, the code tries to create a filesystem from path and if this step failed, it tries to run is_url which doesn't supports s3. s3 reading can fail due to many reasons, from auth to s3 path doesn't exist. The request is to make the error message more useful.
> > arrow:::make_readable_filefunction (file, mmap = TRUE)
> \{
> if (inherits(file, "SubTreeFileSystem")) {
> filesystem <- file$base_fs
> path <- sub("/$", "", file$base_path)
> file <- filesystem$OpenInputFile(path)
> }
> else if (is.string(file)) \{
> if (is_url(file)) {
> file <- tryCatch({
> fs_and_path <- FileSystem$from_uri(file)
> fs_and_path$fs$OpenInputFile(fs_and_path$path)
> }, error = function(e) \{
> MakeRConnectionInputStream(url(file, open = "rb"))
> })
> }
**Reporter**: [Alex Deng](https://issues.apache.org/jira/browse/ARROW-17761)
**Note**: *This issue was originally created as [ARROW-17761](https://issues.apache.org/jira/browse/ARROW-17761). Please see the [migration documentation](https://github.com/apache/arrow/issues/14542) for further details.*
Contributor guide
Research direction
Start at the arrow:::make_readable_file entry point shown in the issue and trace the FileSystem$from_uri error path for an s3 input. Reproduce a failed s3 read, then verify that the resulting message describes the underlying read failure rather than reporting an unsupported URL scheme.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, r
- Domain
- cloud, data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100