MCPcopy Create free account
hub / github.com/apache/paimon-rust / table

Method table

crates/integrations/datafusion/src/catalog.rs:355–393  ·  view source on GitHub ↗
(&self, name: &str)

Source from the content-addressed store, hash-verified

353 }
354
355 async fn table(&self, name: &str) -> DFResult<Option<Arc<dyn TableProvider>>> {
356 if let Some(temp) = &self.temp_provider {
357 if let Some(table) = temp.table(name).await? {
358 return Ok(Some(table));
359 }
360 }
361
362 let (base, system_name) = system_tables::split_object_name(name);
363 if let Some(system_name) = system_name {
364 return await_with_runtime(system_tables::load(
365 Arc::clone(&self.catalog),
366 self.database.clone(),
367 base.to_string(),
368 system_name.to_string(),
369 ))
370 .await;
371 }
372
373 let catalog = Arc::clone(&self.catalog);
374 let dynamic_options = Arc::clone(&self.dynamic_options);
375 let identifier = Identifier::new(self.database.clone(), base);
376 await_with_runtime(async move {
377 match catalog.get_table(&identifier).await {
378 Ok(table) => {
379 let opts = dynamic_options.read().unwrap().clone();
380 let table = if opts.is_empty() {
381 table
382 } else {
383 table.copy_with_options(opts)
384 };
385 let provider = PaimonTableProvider::try_new(table)?;
386 Ok(Some(Arc::new(provider) as Arc<dyn TableProvider>))
387 }
388 Err(paimon::Error::TableNotExist { .. }) => Ok(None),
389 Err(e) => Err(to_datafusion_error(e)),
390 }
391 })
392 .await
393 }
394
395 fn table_exist(&self, name: &str) -> bool {
396 if let Some(temp) = &self.temp_provider {

Callers

nothing calls this directly

Calls 8

split_object_nameFunction · 0.85
await_with_runtimeFunction · 0.85
loadFunction · 0.85
to_datafusion_errorFunction · 0.85
get_tableMethod · 0.45
readMethod · 0.45
is_emptyMethod · 0.45
copy_with_optionsMethod · 0.45

Tested by

no test coverage detected