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

Method table_provider

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

Return a [`TableProvider`] for the specified table.

(
        &self,
        table_ref: impl Into<TableReference>,
    )

Source from the content-addressed store, hash-verified

1995
1996 /// Return a [`TableProvider`] for the specified table.
1997 pub async fn table_provider(
1998 &self,
1999 table_ref: impl Into<TableReference>,
2000 ) -> Result<Arc<dyn TableProvider>> {
2001 let table_ref = table_ref.into();
2002 let table = table_ref.table().to_string();
2003 let schema = self.state.read().schema_for_ref(table_ref)?;
2004 match schema.table(&table).await? {
2005 Some(ref provider) => Ok(Arc::clone(provider)),
2006 _ => plan_err!("No table named '{table}'"),
2007 }
2008 }
2009
2010 /// Get a new TaskContext to run in this session
2011 pub fn task_ctx(&self) -> Arc<TaskContext> {

Callers 4

tableMethod · 0.80

Calls 5

schema_for_refMethod · 0.80
readMethod · 0.80
intoMethod · 0.45
to_stringMethod · 0.45
tableMethod · 0.45

Tested by 2