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

feat: don't map semantic type in metric engine #3243

Merged
merged 2 commits into from
Jan 26, 2024
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
7 changes: 3 additions & 4 deletions src/metric-engine/src/data_region.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ impl DataRegion {

/// Submit an alter request to underlying physical region.
///
/// This method will change the semantic type of those given columns.
/// [SemanticType::Tag] will become [SemanticType::Field]. The procedure framework
/// ensures there is no concurrent conflict.
/// This method will change the nullability of those given columns.
/// [SemanticType::Tag] will become nullable column as it's shared between
/// logical regions.
///
/// Invoker don't need to set up or verify the column id. This method will adjust
/// it using underlying schema.
Expand Down Expand Up @@ -89,7 +89,6 @@ impl DataRegion {
.enumerate()
.map(|(delta, mut c)| {
if c.semantic_type == SemanticType::Tag {
c.semantic_type = SemanticType::Field;
if !c.column_schema.data_type.is_string() {
return ColumnTypeMismatchSnafu {
column_type: c.column_schema.data_type,
Expand Down
13 changes: 0 additions & 13 deletions src/metric-engine/src/engine/put.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ impl MetricEngineInner {
}

/// Perform metric engine specific logic to incoming rows.
/// - Change the semantic type of tag columns to field
/// - Add table_id column
/// - Generate tsid
fn modify_rows(&self, table_id: TableId, rows: &mut Rows) -> Result<()> {
Expand All @@ -141,18 +140,6 @@ impl MetricEngineInner {
})
.collect::<Vec<_>>();

// generate new schema
rows.schema = rows
.schema
.clone()
.into_iter()
.map(|mut col| {
if col.semantic_type == SemanticType::Tag as i32 {
col.semantic_type = SemanticType::Field as i32;
}
col
})
.collect::<Vec<_>>();
// add table_name column
rows.schema.push(ColumnSchema {
column_name: DATA_SCHEMA_TABLE_ID_COLUMN_NAME.to_string(),
Expand Down
Loading