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

Method parse

datafusion/datasource/src/url.rs:106–121  ·  view source on GitHub ↗

Parse a provided string as a `ListingTableUrl` A URL can either refer to a single object, or a collection of objects with a common prefix, with the presence of a trailing `/` indicating a collection. For example, `file:///foo.txt` refers to the file at `/foo.txt`, whereas `file:///foo/` refers to all the files under the directory `/foo` and its subdirectories. Similarly `s3://BUCKET/blob.csv` r

(s: impl AsRef<str>)

Source from the content-addressed store, hash-verified

104 /// [file URI]: https://en.wikipedia.org/wiki/File_URI_scheme
105 /// [URL]: https://url.spec.whatwg.org/
106 pub fn parse(s: impl AsRef<str>) -> Result<Self> {
107 let s = s.as_ref();
108
109 // This is necessary to handle the case of a path starting with a drive letter
110 #[cfg(not(target_arch = "wasm32"))]
111 if std::path::Path::new(s).is_absolute() {
112 return Self::parse_path(s);
113 }
114
115 match Url::parse(s) {
116 Ok(url) => Self::try_new(url, None),
117 #[cfg(not(target_arch = "wasm32"))]
118 Err(url::ParseError::RelativeUrlWithoutBase) => Self::parse_path(s),
119 Err(e) => Err(DataFusionError::External(Box::new(e))),
120 }
121 }
122
123 /// Creates a new [`ListingTableUrl`] interpreting `s` as a filesystem path
124 #[cfg(not(target_arch = "wasm32"))]

Callers 15

update_workspace_versionFunction · 0.45
update_commit_cargo_tomlFunction · 0.45
parse_subcommand_lineFunction · 0.45
parse_metadata_lineFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45

Calls 2

newFunction · 0.85
as_refMethod · 0.45