This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new e4bf951261 Make `ListingTableUrl::try_new` public (#15250)
e4bf951261 is described below
commit e4bf9512616c8fbfdf785e5dcfe509f3bd1524a4
Author: Heran Lin <[email protected]>
AuthorDate: Sun Mar 16 18:33:24 2025 +0800
Make `ListingTableUrl::try_new` public (#15250)
---
datafusion/datasource/src/url.rs | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/datafusion/datasource/src/url.rs b/datafusion/datasource/src/url.rs
index 89e73a8a2b..0667a043e2 100644
--- a/datafusion/datasource/src/url.rs
+++ b/datafusion/datasource/src/url.rs
@@ -136,7 +136,12 @@ impl ListingTableUrl {
}
/// Creates a new [`ListingTableUrl`] from a url and optional glob
expression
- fn try_new(url: Url, glob: Option<Pattern>) -> Result<Self> {
+ ///
+ /// [`Self::parse`] supports glob expression only for file system paths.
+ /// However, some applications may want to support glob expression for
URLs with a scheme.
+ /// The application can split the URL into a base URL and a glob
expression and use this method
+ /// to create a [`ListingTableUrl`].
+ pub fn try_new(url: Url, glob: Option<Pattern>) -> Result<Self> {
let prefix = Path::from_url_path(url.path())?;
Ok(Self { url, prefix, glob })
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]