diff --git a/src/metric-engine/src/engine/alter.rs b/src/metric-engine/src/engine/alter.rs index e2f2153d77ac..aa8e37d8a65c 100644 --- a/src/metric-engine/src/engine/alter.rs +++ b/src/metric-engine/src/engine/alter.rs @@ -93,12 +93,7 @@ impl MetricEngineInner { // register columns to logical region for col in columns { self.metadata_region - .add_column( - metadata_region_id, - region_id, - &col.column_metadata.column_schema.name, - &col.column_metadata, - ) + .add_column(metadata_region_id, region_id, &col.column_metadata) .await?; } diff --git a/src/metric-engine/src/engine/create.rs b/src/metric-engine/src/engine/create.rs index 4281161081b9..f9488ac70e2a 100644 --- a/src/metric-engine/src/engine/create.rs +++ b/src/metric-engine/src/engine/create.rs @@ -185,12 +185,7 @@ impl MetricEngineInner { .await?; for col in &request.column_metadatas { self.metadata_region - .add_column( - metadata_region_id, - logical_region_id, - &col.column_schema.name, - col, - ) + .add_column(metadata_region_id, logical_region_id, col) .await?; } @@ -221,12 +216,7 @@ impl MetricEngineInner { // register columns to metadata region for col in &new_columns { self.metadata_region - .add_column( - metadata_region_id, - logical_region_id, - &col.column_schema.name, - col, - ) + .add_column(metadata_region_id, logical_region_id, col) .await?; } diff --git a/src/metric-engine/src/metadata_region.rs b/src/metric-engine/src/metadata_region.rs index e8e808eed7b5..0621b9a3fd17 100644 --- a/src/metric-engine/src/metadata_region.rs +++ b/src/metric-engine/src/metadata_region.rs @@ -97,11 +97,11 @@ impl MetadataRegion { &self, physical_region_id: RegionId, logical_region_id: RegionId, - column_name: &str, column_metadata: &ColumnMetadata, ) -> Result { let region_id = utils::to_metadata_region_id(physical_region_id); - let column_key = Self::concat_column_key(logical_region_id, column_name); + let column_key = + Self::concat_column_key(logical_region_id, &column_metadata.column_schema.name); self.put_if_absent( region_id, @@ -629,12 +629,7 @@ mod test { column_id: 5, }; metadata_region - .add_column( - physical_region_id, - logical_region_id, - column_name, - &column_metadata, - ) + .add_column(physical_region_id, logical_region_id, &column_metadata) .await .unwrap(); let actual_semantic_type = metadata_region @@ -645,12 +640,7 @@ mod test { // duplicate column won't be updated let is_updated = metadata_region - .add_column( - physical_region_id, - logical_region_id, - column_name, - &column_metadata, - ) + .add_column(physical_region_id, logical_region_id, &column_metadata) .await .unwrap(); assert!(!is_updated);