Skip to content

[fs] Fix globbing in the scala blob storage FS - #13173

Merged
danking merged 2 commits into
hail-is:mainfrom
daniel-goldstein:fix-scala-globbing
Jun 13, 2023
Merged

danking merged 2 commits into
hail-is:mainfrom
daniel-goldstein:fix-scala-globbing

Conversation

@daniel-goldstein

@daniel-goldstein daniel-goldstein commented Jun 12, 2023 •

Copy link
Copy Markdown
Contributor

Using URL parsing for object storage URIs has proven problematic as they don't really have the same syntax. In particular, Java URI truncates the path at ? and assigns the rest to a query string field (as it should), but ? is a valid character in a blob storage object and is used as a glob pattern. We were forgetting to look at the URI.query field to assemble the full object name and therefore broke globbing. I added a few tests specifically that used single-character match pattern (?) and got rid of URI in favor of a regex to get ahead of any other potential footguns.

}
parseHttpsUrl(filename)
.orElse(parseHailAzUrl(filename))
.getOrElse(throw new IllegalArgumentException("ABS URI must be of the form https://<ACCOUNT>.blob.core.windows.net/<CONTAINER>/<PATH>"))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error reporting has gotten a little worse. Before we gave specialized errors depending on the scheme. Maybe it's worthwhile to still match the scheme first, then match the rest with the appropriate regex?

@danking
danking merged commit 18ad85f into hail-is:main Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants