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

Method refresh_catalogs

datafusion/core/src/execution/context/mod.rs:315–332  ·  view source on GitHub ↗

Finds any [`ListingSchemaProvider`]s and instructs them to reload tables from "disk"

(&self)

Source from the content-addressed store, hash-verified

313
314 /// Finds any [`ListingSchemaProvider`]s and instructs them to reload tables from "disk"
315 pub async fn refresh_catalogs(&self) -> Result<()> {
316 let cat_names = self.catalog_names().clone();
317 for cat_name in cat_names.iter() {
318 let cat = self
319 .catalog(cat_name.as_str())
320 .ok_or_else(|| internal_datafusion_err!("Catalog not found!"))?;
321 for schema_name in cat.schema_names() {
322 let schema = cat
323 .schema(schema_name.as_str())
324 .ok_or_else(|| internal_datafusion_err!("Schema not found!"))?;
325 let lister = schema.downcast_ref::<ListingSchemaProvider>();
326 if let Some(lister) = lister {
327 lister.refresh(&self.state()).await?;
328 }
329 }
330 }
331 Ok(())
332 }
333
334 /// Creates a new `SessionContext` using the provided
335 /// [`SessionConfig`] and a new [`RuntimeEnv`].

Callers 2

main_innerFunction · 0.80

Calls 9

refreshMethod · 0.80
cloneMethod · 0.45
catalog_namesMethod · 0.45
iterMethod · 0.45
catalogMethod · 0.45
as_strMethod · 0.45
schema_namesMethod · 0.45
schemaMethod · 0.45
stateMethod · 0.45

Tested by

no test coverage detected