Skip to content

Commit

Permalink
spi-search:fix in.
Browse files Browse the repository at this point in the history
  • Loading branch information
ljl committed Mar 6, 2024
1 parent 3dec916 commit aaa5132
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spi/spi-search/src/serv/pg/search_pg_item_serv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1124,23 +1124,23 @@ pub async fn query_metrics(query_req: &SearchQueryMetricsReq, funs: &TardisFunsI
if ext_item.op == BasicQueryOpKind::In {
if !value.is_empty() {
sql_and_where.push(format!(
"fact.{} LIKE ANY (ARRAY[{}])",
"fact.{} IN ({})",
ext_item.field,
(0..value.len()).map(|idx| format!("${}", params.len() + idx + 1)).collect::<Vec<String>>().join(",")
));
for val in value {
params.push(Value::from(format!("{val}%")));
params.push(val);
}
}
} else if ext_item.op == BasicQueryOpKind::NotIn {
if !value.is_empty() {
sql_and_where.push(format!(
"fact.{} NOT LIKE ANY (ARRAY[{}])",
"fact.{} NOT IN ({})",
ext_item.field,
(0..value.len()).map(|idx| format!("${}", params.len() + idx + 1)).collect::<Vec<String>>().join(",")
));
for val in value {
params.push(Value::from(format!("{val}%")));
params.push(val);
}
}
} else if ext_item.op == BasicQueryOpKind::IsNull {
Expand Down

0 comments on commit aaa5132

Please sign in to comment.