MCPcopy Create free account
hub / github.com/apache/datafusion / try_new

Method try_new

datafusion/datasource/src/url.rs:150–158  ·  view source on GitHub ↗

Creates a new [`ListingTableUrl`] from a url and optional glob expression [`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`].

(url: Url, glob: Option<Pattern>)

Source from the content-addressed store, hash-verified

148 /// The application can split the URL into a base URL and a glob expression and use this method
149 /// to create a [`ListingTableUrl`].
150 pub fn try_new(url: Url, glob: Option<Pattern>) -> Result<Self> {
151 let prefix = Path::from_url_path(url.path())?;
152 Ok(Self {
153 url,
154 prefix,
155 glob,
156 table_ref: None,
157 })
158 }
159
160 /// Returns the URL scheme
161 pub fn scheme(&self) -> &str {

Callers

nothing calls this directly

Calls 1

pathMethod · 0.45

Tested by

no test coverage detected