Skip to content

Commit

Permalink
chore: fix some issue by pr commit
Browse files Browse the repository at this point in the history
  • Loading branch information
paomian committed Jun 14, 2024
1 parent b57eed6 commit 5533c8e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
12 changes: 3 additions & 9 deletions src/operator/src/insert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/operator/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 3 additions & 1 deletion src/pipeline/src/manager/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Check warning on line 52 in src/pipeline/src/manager/table.rs

View workflow job for this annotation

GitHub Actions / Check typos and docs

"formated" should be "formatted".
/// if the version is None, it means the latest version of the pipeline
pub type PipelineVersion = Option<TimestampNanosecond>;

pub type PipelineTableRef = Arc<PipelineTable>;
Expand Down Expand Up @@ -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::<i64>::into(version)),
Some(version) => format!("{}/{}/{}", schema, name, i64::from(version)),
None => format!("{}/{}/latest", schema, name),
}
}
Expand Down

0 comments on commit 5533c8e

Please sign in to comment.