Skip to content

Commit

Permalink
Merge branch 'main' into zz-open-0325
Browse files Browse the repository at this point in the history
  • Loading branch information
ZzIsGod1019 committed Mar 26, 2024
2 parents 2f458a5 + 1e18fea commit 56c9b1a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spi/spi-stats/src/serv/pg/stats_pg_conf_fact_serv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ async fn do_paginate(
let table_col_name = package_table_name("stats_conf_fact_col", ctx);
let mut sql_where = vec!["1 = 1".to_string()];
let mut sql_order = vec![];
let mut sql_left = "";
let mut sql_left = "".to_string();
let mut params: Vec<Value> = vec![Value::from(page_size), Value::from((page_number - 1) * page_size)];
if let Some(fact_conf_key) = &fact_conf_key {
sql_where.push(format!("fact.key = ${}", params.len() + 1));
Expand All @@ -204,7 +204,7 @@ async fn do_paginate(
}
if let Some(dim_rel_conf_dim_keys) = &dim_rel_conf_dim_keys {
if !dim_rel_conf_dim_keys.is_empty() {
sql_left = &format!(
sql_left = format!(
r#" LEFT JOIN (SELECT rel_conf_fact_key,COUNT(rel_conf_fact_key) FROM {table_col_name} WHERE dim_rel_conf_dim_key IN ({}) GROUP BY rel_conf_fact_key HAVING COUNT(rel_conf_fact_key) = {}) AS fact_col ON fact.key = fact_col.rel_conf_fact_key"#,
(0..dim_rel_conf_dim_keys.len()).map(|idx| format!("${}", params.len() + idx + 1)).collect::<Vec<String>>().join(","),
dim_rel_conf_dim_keys.len()
Expand Down Expand Up @@ -235,7 +235,7 @@ WHERE
) as t
LIMIT $1 OFFSET $2
"#,
sql_left,
sql_left,
sql_where.join(" AND "),
if sql_order.is_empty() {
"".to_string()
Expand Down

0 comments on commit 56c9b1a

Please sign in to comment.