| 279 | } |
| 280 | |
| 281 | async fn get_table(&self, identifier: &Identifier) -> Result<Table> { |
| 282 | let table_path = self.table_path(identifier); |
| 283 | |
| 284 | if !self.table_exists(identifier).await? { |
| 285 | return Err(Error::TableNotExist { |
| 286 | full_name: identifier.full_name(), |
| 287 | }); |
| 288 | } |
| 289 | |
| 290 | let schema = self |
| 291 | .load_latest_table_schema(&table_path) |
| 292 | .await? |
| 293 | .ok_or_else(|| Error::TableNotExist { |
| 294 | full_name: identifier.full_name(), |
| 295 | })?; |
| 296 | |
| 297 | Ok(Table::new( |
| 298 | self.file_io.clone(), |
| 299 | identifier.clone(), |
| 300 | table_path, |
| 301 | schema, |
| 302 | None, |
| 303 | )) |
| 304 | } |
| 305 | |
| 306 | async fn list_tables(&self, database_name: &str) -> Result<Vec<String>> { |
| 307 | let path = self.database_path(database_name); |