From 3b592fa859d7731165c0f5499dae92aa5e14947a Mon Sep 17 00:00:00 2001 From: WenyXu Date: Wed, 6 Nov 2024 06:49:09 +0000 Subject: [PATCH] chore: add logs --- Cargo.lock | 1 + src/store-api/Cargo.toml | 1 + src/store-api/src/metadata.rs | 11 +++++++++++ 3 files changed, 13 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index eb8a6f7db406..19e361809a72 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11632,6 +11632,7 @@ dependencies = [ "common-macro", "common-meta", "common-recordbatch", + "common-telemetry", "common-time", "common-wal", "datafusion-expr", diff --git a/src/store-api/Cargo.toml b/src/store-api/Cargo.toml index 2d11b31ebe45..e1fc58f576e5 100644 --- a/src/store-api/Cargo.toml +++ b/src/store-api/Cargo.toml @@ -15,6 +15,7 @@ common-base.workspace = true common-error.workspace = true common-macro.workspace = true common-recordbatch.workspace = true +common-telemetry.workspace = true common-time.workspace = true common-wal.workspace = true datafusion-expr.workspace = true diff --git a/src/store-api/src/metadata.rs b/src/store-api/src/metadata.rs index 3a08523b900d..039ba4885f3b 100644 --- a/src/store-api/src/metadata.rs +++ b/src/store-api/src/metadata.rs @@ -27,6 +27,7 @@ use api::v1::SemanticType; use common_error::ext::ErrorExt; use common_error::status_code::StatusCode; use common_macro::stack_trace_debug; +use common_telemetry::info; use datatypes::arrow::datatypes::FieldRef; use datatypes::schema::{ColumnSchema, Schema, SchemaRef}; use serde::de::Error; @@ -333,6 +334,16 @@ impl RegionMetadata { // Check whether column id is duplicated. We already check column name // is unique in `Schema` so we only check column id here. + if id_names.contains_key(&col.column_id) { + info!( + "The column {} and {} have the same column id {}, region_id: {}, schema: {:?}", + id_names[&col.column_id], + col.column_schema.name, + col.column_id, + self.region_id, + self.schema, + ); + } ensure!( !id_names.contains_key(&col.column_id), InvalidMetaSnafu {