From 5bf31f57bcb46c962395e27b787b2328053a0108 Mon Sep 17 00:00:00 2001 From: evenyag Date: Mon, 18 Sep 2023 21:47:11 +0800 Subject: [PATCH] chore: Remove unused engine_options --- src/cmd/src/cli/bench.rs | 1 - src/common/meta/src/key/table_info.rs | 1 - src/meta-srv/src/procedure/utils.rs | 2 -- src/meta-srv/src/table_routes.rs | 3 --- src/operator/src/statement/ddl.rs | 1 - src/query/src/sql/show_create_table.rs | 2 -- src/table/src/metadata.rs | 8 -------- src/table/src/test_util/memtable.rs | 1 - src/table/src/test_util/table_info.rs | 1 - 9 files changed, 20 deletions(-) diff --git a/src/cmd/src/cli/bench.rs b/src/cmd/src/cli/bench.rs index fbeb70fef5e6..54373cfa7ac9 100644 --- a/src/cmd/src/cli/bench.rs +++ b/src/cmd/src/cli/bench.rs @@ -120,7 +120,6 @@ fn create_table_info(table_id: TableId, table_name: TableName) -> RawTableInfo { created_on: chrono::DateTime::default(), primary_key_indices: vec![], next_column_id: columns as u32 + 1, - engine_options: Default::default(), value_indices: vec![], options: Default::default(), region_numbers: (1..=100).collect(), diff --git a/src/common/meta/src/key/table_info.rs b/src/common/meta/src/key/table_info.rs index 9ca861444603..50d7e56d5164 100644 --- a/src/common/meta/src/key/table_info.rs +++ b/src/common/meta/src/key/table_info.rs @@ -275,7 +275,6 @@ mod tests { created_on: chrono::DateTime::default(), primary_key_indices: vec![0, 1], next_column_id: 3, - engine_options: Default::default(), value_indices: vec![2, 3], options: Default::default(), region_numbers: vec![1], diff --git a/src/meta-srv/src/procedure/utils.rs b/src/meta-srv/src/procedure/utils.rs index 965ae2603713..b884e70a0a03 100644 --- a/src/meta-srv/src/procedure/utils.rs +++ b/src/meta-srv/src/procedure/utils.rs @@ -100,7 +100,6 @@ pub mod mock { #[cfg(test)] pub mod test_data { - use std::collections::HashMap; use std::sync::Arc; use chrono::DateTime; @@ -178,7 +177,6 @@ pub mod test_data { engine: MITO2_ENGINE.to_string(), next_column_id: 3, region_numbers: vec![1, 2, 3], - engine_options: HashMap::new(), options: TableOptions::default(), created_on: DateTime::default(), partition_key_indices: vec![], diff --git a/src/meta-srv/src/table_routes.rs b/src/meta-srv/src/table_routes.rs index cbdfd12263a9..170082aae5ce 100644 --- a/src/meta-srv/src/table_routes.rs +++ b/src/meta-srv/src/table_routes.rs @@ -70,8 +70,6 @@ pub(crate) async fn fetch_tables( #[cfg(test)] pub(crate) mod tests { - use std::collections::HashMap; - use chrono::DateTime; use common_catalog::consts::{DEFAULT_CATALOG_NAME, DEFAULT_SCHEMA_NAME, MITO_ENGINE}; use common_meta::key::TableMetadataManagerRef; @@ -103,7 +101,6 @@ pub(crate) mod tests { engine: MITO_ENGINE.to_string(), next_column_id: 1, region_numbers: vec![1, 2, 3, 4], - engine_options: HashMap::new(), options: TableOptions::default(), created_on: DateTime::default(), partition_key_indices: vec![], diff --git a/src/operator/src/statement/ddl.rs b/src/operator/src/statement/ddl.rs index 460f971df53f..768f03a35878 100644 --- a/src/operator/src/statement/ddl.rs +++ b/src/operator/src/statement/ddl.rs @@ -446,7 +446,6 @@ fn create_table_info( engine: create_table.engine.clone(), next_column_id: column_schemas.len() as u32, region_numbers: vec![], - engine_options: HashMap::new(), options: table_options, created_on: DateTime::default(), partition_key_indices, diff --git a/src/query/src/sql/show_create_table.rs b/src/query/src/sql/show_create_table.rs index f67623ce7e8e..97d8aba4fbbf 100644 --- a/src/query/src/sql/show_create_table.rs +++ b/src/query/src/sql/show_create_table.rs @@ -228,7 +228,6 @@ mod tests { .value_indices(vec![2, 3]) .engine("mito".to_string()) .next_column_id(0) - .engine_options(Default::default()) .options(Default::default()) .created_on(Default::default()) .region_numbers(regions) @@ -297,7 +296,6 @@ WITH( .primary_key_indices(vec![]) .engine("file".to_string()) .next_column_id(0) - .engine_options(Default::default()) .options(options) .created_on(Default::default()) .build() diff --git a/src/table/src/metadata.rs b/src/table/src/metadata.rs index 754d5dd7acc5..0a0c598c5625 100644 --- a/src/table/src/metadata.rs +++ b/src/table/src/metadata.rs @@ -107,10 +107,6 @@ pub struct TableMeta { #[builder(default, setter(into))] pub region_numbers: Vec, pub next_column_id: ColumnId, - // TODO(yingwen): Remove engine_options. - /// Options for table engine. - #[builder(default)] - pub engine_options: HashMap, /// Table options. #[builder(default)] pub options: TableOptions, @@ -230,7 +226,6 @@ impl TableMeta { let mut builder = TableMetaBuilder::default(); let _ = builder .engine(&self.engine) - .engine_options(self.engine_options.clone()) .options(self.options.clone()) .created_on(self.created_on) .region_numbers(self.region_numbers.clone()) @@ -532,7 +527,6 @@ pub struct RawTableMeta { pub engine: String, pub next_column_id: ColumnId, pub region_numbers: Vec, - pub engine_options: HashMap, pub options: TableOptions, pub created_on: DateTime, #[serde(default)] @@ -548,7 +542,6 @@ impl From for RawTableMeta { engine: meta.engine, next_column_id: meta.next_column_id, region_numbers: meta.region_numbers, - engine_options: meta.engine_options, options: meta.options, created_on: meta.created_on, partition_key_indices: meta.partition_key_indices, @@ -567,7 +560,6 @@ impl TryFrom for TableMeta { engine: raw.engine, region_numbers: raw.region_numbers, next_column_id: raw.next_column_id, - engine_options: raw.engine_options, options: raw.options, created_on: raw.created_on, partition_key_indices: raw.partition_key_indices, diff --git a/src/table/src/test_util/memtable.rs b/src/table/src/test_util/memtable.rs index 35dbdf3d30d8..cb36bac2c77c 100644 --- a/src/table/src/test_util/memtable.rs +++ b/src/table/src/test_util/memtable.rs @@ -73,7 +73,6 @@ impl MemTable { .value_indices(vec![]) .engine("mito".to_string()) .next_column_id(0) - .engine_options(Default::default()) .options(Default::default()) .created_on(Default::default()) .region_numbers(regions) diff --git a/src/table/src/test_util/table_info.rs b/src/table/src/test_util/table_info.rs index ae061ccb02ae..7ddf6c019cca 100644 --- a/src/table/src/test_util/table_info.rs +++ b/src/table/src/test_util/table_info.rs @@ -29,7 +29,6 @@ pub fn test_table_info( .value_indices(vec![]) .engine("mito".to_string()) .next_column_id(0) - .engine_options(Default::default()) .options(Default::default()) .created_on(Default::default()) .region_numbers(vec![1])