From 5533c8e171d57cab1dc88843fd3979577f3e1607 Mon Sep 17 00:00:00 2001 From: paomian Date: Fri, 14 Jun 2024 23:29:56 +0800 Subject: [PATCH] chore: fix some issue by pr commit --- src/operator/src/insert.rs | 12 +++--------- src/operator/src/metrics.rs | 6 +++--- src/pipeline/src/manager/table.rs | 4 +++- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/operator/src/insert.rs b/src/operator/src/insert.rs index 4caf06c0ca90..4bae21f987b9 100644 --- a/src/operator/src/insert.rs +++ b/src/operator/src/insert.rs @@ -437,7 +437,7 @@ impl Inserter { let mut table_name_to_ids = HashMap::with_capacity(requests.inserts.len()); let mut create_tables = vec![]; let mut alter_tables = vec![]; - let _timer = crate::metrics::CREATE_OR_ALTER_TABLES + let _timer = crate::metrics::CREATE_ALTER_ON_DEMAND .with_label_values(&[auto_create_table_type.as_str()]) .start_timer(); for req in &requests.inserts { @@ -636,17 +636,11 @@ impl Inserter { match res { Ok(table) => { - info!( - "Successfully created table {}.{}.{}", - table_ref.catalog, table_ref.schema, table_ref.table, - ); + info!("Successfully created table {}", table_ref,); Ok(table) } Err(err) => { - error!( - "Failed to create table {}.{}.{}: {}", - table_ref.catalog, table_ref.schema, table_ref.table, err - ); + error!(err; "Failed to create table {}", table_ref); Err(err) } } diff --git a/src/operator/src/metrics.rs b/src/operator/src/metrics.rs index f902465677b3..9a77f9844d38 100644 --- a/src/operator/src/metrics.rs +++ b/src/operator/src/metrics.rs @@ -51,9 +51,9 @@ lazy_static! { "DDL operator create view" ) .unwrap(); - pub static ref CREATE_OR_ALTER_TABLES: HistogramVec = register_histogram_vec!( - "greptime_table_operator_create_or_alter_tables", - "table operator create or alter tables", + pub static ref CREATE_ALTER_ON_DEMAND: HistogramVec = register_histogram_vec!( + "greptime_table_operator_create_alter_on_demand", + "table operator duration to create or alter tables on demand", &["table_type"] ) .unwrap(); diff --git a/src/pipeline/src/manager/table.rs b/src/pipeline/src/manager/table.rs index 662e740a04c3..4ac7524172eb 100644 --- a/src/pipeline/src/manager/table.rs +++ b/src/pipeline/src/manager/table.rs @@ -49,6 +49,8 @@ use crate::error::{ use crate::etl::transform::GreptimeTransformer; use crate::etl::{parse, Content, Pipeline}; +/// Pipeline version. string formated as iso8601 timestamp with nanosecond precision +/// if the version is None, it means the latest version of the pipeline pub type PipelineVersion = Option; pub type PipelineTableRef = Arc; @@ -209,7 +211,7 @@ impl PipelineTable { fn generate_pipeline_cache_key(schema: &str, name: &str, version: PipelineVersion) -> String { match version { - Some(version) => format!("{}/{}/{}", schema, name, Into::::into(version)), + Some(version) => format!("{}/{}/{}", schema, name, i64::from(version)), None => format!("{}/{}/latest", schema, name), } }