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>)
| 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 | /// |