(&self, cmd: CreateCatalog)
| 1028 | } |
| 1029 | |
| 1030 | async fn create_catalog(&self, cmd: CreateCatalog) -> Result<DataFrame> { |
| 1031 | let CreateCatalog { |
| 1032 | catalog_name, |
| 1033 | if_not_exists, |
| 1034 | .. |
| 1035 | } = cmd; |
| 1036 | let catalog = self.catalog(catalog_name.as_str()); |
| 1037 | |
| 1038 | match (if_not_exists, catalog) { |
| 1039 | (true, Some(_)) => self.return_empty_dataframe(), |
| 1040 | (true, None) | (false, None) => { |
| 1041 | let new_catalog = Arc::new(MemoryCatalogProvider::new()); |
| 1042 | self.state |
| 1043 | .write() |
| 1044 | .catalog_list() |
| 1045 | .register_catalog(catalog_name, new_catalog); |
| 1046 | self.return_empty_dataframe() |
| 1047 | } |
| 1048 | (false, Some(_)) => exec_err!("Catalog '{catalog_name}' already exists"), |
| 1049 | } |
| 1050 | } |
| 1051 | |
| 1052 | async fn drop_table(&self, cmd: DropTable) -> Result<DataFrame> { |
| 1053 | let DropTable { |
no test coverage detected