Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: catalog #1454

Merged
merged 15 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions src/catalog/src/datafusion.rs

This file was deleted.

324 changes: 0 additions & 324 deletions src/catalog/src/datafusion/catalog_adapter.rs

This file was deleted.

1 change: 1 addition & 0 deletions src/catalog/src/helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ impl TableRegionalKey {
pub struct TableRegionalValue {
pub version: TableVersion,
pub regions_ids: Vec<u32>,
pub engine_name: Option<String>,
v0y4g3r marked this conversation as resolved.
Show resolved Hide resolved
}

pub struct CatalogKey {
Expand Down
4 changes: 2 additions & 2 deletions src/catalog/src/information_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl SchemaProvider for InformationSchemaProvider {
self
}

fn table_names(&self) -> Result<Vec<String>> {
async fn table_names(&self) -> Result<Vec<String>> {
Ok(vec![TABLES.to_string()])
}

Expand All @@ -74,7 +74,7 @@ impl SchemaProvider for InformationSchemaProvider {
Ok(Some(Arc::new(table)))
}

fn table_exist(&self, name: &str) -> Result<bool> {
async fn table_exist(&self, name: &str) -> Result<bool> {
Ok(matches!(name.to_ascii_lowercase().as_str(), TABLES))
}
}
6 changes: 3 additions & 3 deletions src/catalog/src/information_schema/tables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ impl InformationSchemaTablesBuilder {
async fn make_tables(&mut self) -> Result<RecordBatch> {
let catalog_name = self.catalog_name.clone();

for schema_name in self.catalog_provider.schema_names()? {
for schema_name in self.catalog_provider.schema_names().await? {
if schema_name == INFORMATION_SCHEMA_NAME {
continue;
}

let Some(schema) = self.catalog_provider.schema(&schema_name)? else { continue };
for table_name in schema.table_names()? {
let Some(schema) = self.catalog_provider.schema(&schema_name).await? else { continue };
for table_name in schema.table_names().await? {
let Some(table) = schema.table(&table_name).await? else { continue };
let table_info = table.table_info();
self.add_table(
Expand Down
Loading