feat: support multi table engines (#1277)

* feat: support multi table engines

* refactor: adapt SqlHandler to support multiple table engines

* refactor: refactor TableEngineManager

* chore: apply review suggestions

* chore: apply review suggestions

* chore: apply review suggestions

* chore: snafu context styling
This commit is contained in:
Weny Xu
2023-04-03 23:49:12 +09:00
committed by GitHub
parent 68d3247791
commit 451f9d2d4e
34 changed files with 454 additions and 135 deletions

View File

@@ -117,6 +117,7 @@ mod tests {
use mito::config::EngineConfig as TableEngineConfig;
use mito::table::test_util::new_test_object_store;
use query::QueryEngineFactory;
use table::engine::manager::MemoryTableEngineManager;
use super::*;
type DefaultEngine = MitoEngine<EngineImpl<RaftEngineLogStore>>;
@@ -153,9 +154,9 @@ mod tests {
),
object_store,
));
let engine_manager = Arc::new(MemoryTableEngineManager::new(mock_engine.clone()));
let catalog_manager = Arc::new(
catalog::local::LocalCatalogManager::try_new(mock_engine.clone())
catalog::local::LocalCatalogManager::try_new(engine_manager)
.await
.unwrap(),
);

View File

@@ -17,7 +17,9 @@ use std::collections::HashMap;
use std::sync::Arc;
use catalog::{CatalogManagerRef, RegisterSystemTableRequest};
use common_catalog::consts::{DEFAULT_CATALOG_NAME, DEFAULT_SCHEMA_NAME, SCRIPTS_TABLE_ID};
use common_catalog::consts::{
DEFAULT_CATALOG_NAME, DEFAULT_SCHEMA_NAME, MITO_ENGINE, SCRIPTS_TABLE_ID,
};
use common_catalog::format_full_table_name;
use common_query::Output;
use common_recordbatch::util as record_util;
@@ -65,6 +67,7 @@ impl ScriptsTable {
primary_key_indices: vec![0, 1],
create_if_not_exists: true,
table_options: TableOptions::default(),
engine: MITO_ENGINE.to_string(),
};
catalog_manager