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

Function try_list_prefixed_files

datafusion/datasource/src/url.rs:1058–1075  ·  view source on GitHub ↗

Runs "list_prefixed_files" and returns their paths

(
        url: &str,
        store: &dyn ObjectStore,
        prefix: Option<Path>,
        file_extension: &str,
    )

Source from the content-addressed store, hash-verified

1056
1057 /// Runs "list_prefixed_files" and returns their paths
1058 async fn try_list_prefixed_files(
1059 url: &str,
1060 store: &dyn ObjectStore,
1061 prefix: Option<Path>,
1062 file_extension: &str,
1063 ) -> Result<Vec<String>> {
1064 let session = MockSession::new();
1065 let url = ListingTableUrl::parse(url)?;
1066 let files = url
1067 .list_prefixed_files(&session, store, prefix, file_extension)
1068 .await?
1069 .try_collect::<Vec<_>>()
1070 .await?
1071 .into_iter()
1072 .map(|meta| meta.location.as_ref().to_string())
1073 .collect();
1074 Ok(files)
1075 }
1076
1077 #[derive(Debug)]
1078 struct MockObjectStore {

Callers 2

list_all_filesFunction · 0.85
list_prefixed_filesFunction · 0.85

Calls 7

newFunction · 0.85
collectMethod · 0.80
list_prefixed_filesMethod · 0.80
mapMethod · 0.45
into_iterMethod · 0.45
to_stringMethod · 0.45
as_refMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…