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

Method parse_path

datafusion/datasource/src/url.rs:125–142  ·  view source on GitHub ↗
(s: &str)

Source from the content-addressed store, hash-verified

123 /// Creates a new [`ListingTableUrl`] interpreting `s` as a filesystem path
124 #[cfg(not(target_arch = "wasm32"))]
125 fn parse_path(s: &str) -> Result<Self> {
126 let (path, glob) = match split_glob_expression(s) {
127 Some((prefix, glob)) => {
128 let glob = Pattern::new(glob)
129 .map_err(|e| DataFusionError::External(Box::new(e)))?;
130 (prefix, Some(glob))
131 }
132 None => (s, None),
133 };
134
135 let url = url_from_filesystem_path(path).ok_or_else(|| {
136 DataFusionError::External(
137 format!("Failed to convert path to URL: {path}").into(),
138 )
139 })?;
140
141 Self::try_new(url, glob)
142 }
143
144 /// Creates a new [`ListingTableUrl`] from a url and optional glob expression
145 ///

Callers

nothing calls this directly

Calls 4

split_glob_expressionFunction · 0.85
newFunction · 0.85
url_from_filesystem_pathFunction · 0.85
intoMethod · 0.45

Tested by

no test coverage detected