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

Method table

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

Retrieves a [`DataFrame`] representing a table previously registered by calling the [`register_table`] function. Returns an error if no table has been registered with the provided reference. [`register_table`]: SessionContext::register_table

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

Source from the content-addressed store, hash-verified

1968 ///
1969 /// [`register_table`]: SessionContext::register_table
1970 pub async fn table(&self, table_ref: impl Into<TableReference>) -> Result<DataFrame> {
1971 let table_ref: TableReference = table_ref.into();
1972 let provider = self.table_provider(table_ref.clone()).await?;
1973 let plan = LogicalPlanBuilder::scan(
1974 table_ref,
1975 provider_as_source(Arc::clone(&provider)),
1976 None,
1977 )?
1978 .build()?;
1979 Ok(DataFrame::new(self.state(), plan))
1980 }
1981
1982 /// Retrieves a [`TableFunction`] reference by name.
1983 ///

Callers 15

runFunction · 0.45
criterion_benchmarkFunction · 0.45
build_test_data_frameFunction · 0.45
filter_pushdown_viewFunction · 0.45
limit_pushdown_viewFunction · 0.45
write_tableMethod · 0.45
test_table_with_nameFunction · 0.45
statement_to_planMethod · 0.45

Calls 8

provider_as_sourceFunction · 0.85
newFunction · 0.85
table_providerMethod · 0.80
scanFunction · 0.50
intoMethod · 0.45
cloneMethod · 0.45
buildMethod · 0.45
stateMethod · 0.45

Tested by 4

filter_pushdown_viewFunction · 0.36
limit_pushdown_viewFunction · 0.36
test_table_with_nameFunction · 0.36