refactor: system tables in FrontendCatalogManager (#2358)

* rename method names

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* remove system table, table engine, register/deregister

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* add system catalog

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* run nextest

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* some documents

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* fix: fix clippy

---------

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
Co-authored-by: WenyXu <wenymedia@gmail.com>
This commit is contained in:
Ruihang Xia
2023-09-12 05:45:47 -05:00
parent 46eca5026e
commit 1ad5f6e5d5
20 changed files with 114 additions and 1039 deletions

View File

@@ -486,7 +486,7 @@ mod tests {
use std::borrow::Cow::Borrowed;
use std::sync::Arc;
use catalog::{CatalogManager, RegisterTableRequest};
use catalog::RegisterTableRequest;
use common_catalog::consts::{DEFAULT_CATALOG_NAME, DEFAULT_SCHEMA_NAME, NUMBERS_TABLE_ID};
use common_query::Output;
use common_recordbatch::{util, RecordBatch};
@@ -515,7 +515,7 @@ mod tests {
table_id: NUMBERS_TABLE_ID,
table: NumbersTable::table(NUMBERS_TABLE_ID),
};
catalog_manager.register_local_table(req).unwrap();
catalog_manager.register_table_sync(req).unwrap();
QueryEngineFactory::new(catalog_manager, None, false).query_engine()
}

View File

@@ -326,7 +326,7 @@ fn have_range_in_exprs(exprs: &Vec<Expr>) -> bool {
mod test {
use catalog::local::MemoryCatalogManager;
use catalog::{CatalogManager, RegisterTableRequest};
use catalog::RegisterTableRequest;
use common_catalog::consts::{DEFAULT_CATALOG_NAME, DEFAULT_SCHEMA_NAME};
use datatypes::prelude::ConcreteDataType;
use datatypes::schema::{ColumnSchema, Schema};
@@ -380,7 +380,7 @@ mod test {
let table = EmptyTable::from_table_info(&table_info);
let catalog_list = MemoryCatalogManager::with_default_setup();
assert!(catalog_list
.register_local_table(RegisterTableRequest {
.register_table_sync(RegisterTableRequest {
catalog: DEFAULT_CATALOG_NAME.to_string(),
schema: DEFAULT_SCHEMA_NAME.to_string(),
table_name,

View File

@@ -112,7 +112,7 @@ fn catalog_manager() -> Result<Arc<MemoryCatalogManager>> {
table_id: NUMBERS_TABLE_ID,
table: NumbersTable::table(NUMBERS_TABLE_ID),
};
let _ = catalog_manager.register_table(req).unwrap();
let _ = catalog_manager.register_table_sync(req).unwrap();
Ok(catalog_manager)
}

View File

@@ -104,7 +104,7 @@ fn create_test_engine() -> TimeRangeTester {
table_id: table.table_info().ident.table_id,
table: table.clone(),
};
let _ = catalog_manager.register_table(req).unwrap();
let _ = catalog_manager.register_table_sync(req).unwrap();
let engine = QueryEngineFactory::new(catalog_manager, None, false).query_engine();
TimeRangeTester { engine, filter }