Skip to content

Commit e4bf951

Browse files
authored
Make ListingTableUrl::try_new public (#15250)
1 parent 72b855b commit e4bf951

File tree

1 file changed

+6
-1
lines changed
  • datafusion/datasource/src

1 file changed

+6
-1
lines changed

datafusion/datasource/src/url.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,12 @@ impl ListingTableUrl {
136136
}
137137

138138
/// Creates a new [`ListingTableUrl`] from a url and optional glob expression
139-
fn try_new(url: Url, glob: Option<Pattern>) -> Result<Self> {
139+
///
140+
/// [`Self::parse`] supports glob expression only for file system paths.
141+
/// However, some applications may want to support glob expression for URLs with a scheme.
142+
/// The application can split the URL into a base URL and a glob expression and use this method
143+
/// to create a [`ListingTableUrl`].
144+
pub fn try_new(url: Url, glob: Option<Pattern>) -> Result<Self> {
140145
let prefix = Path::from_url_path(url.path())?;
141146
Ok(Self { url, prefix, glob })
142147
}

0 commit comments

Comments
 (0)