diff --git a/src/query/service/src/pipelines/processors/transforms/transform_dictionary.rs b/src/query/service/src/pipelines/processors/transforms/transform_dictionary.rs index c335e6aa4143f..ee5eb0f1e2809 100644 --- a/src/query/service/src/pipelines/processors/transforms/transform_dictionary.rs +++ b/src/query/service/src/pipelines/processors/transforms/transform_dictionary.rs @@ -57,7 +57,7 @@ use crate::sql::IndexType; macro_rules! sqlx_fetch_optional { ($pool:expr, $sql:expr, $key_type:ty, $val_type:ty, $format_val_fn:expr) => {{ - let res: Option<(Option<$key_type>, Option<$val_type>)> = + let res: Option<($key_type, Option<$val_type>)> = sqlx::query_as(&$sql).fetch_optional($pool).await?; Ok(res.and_then(|(_, v)| v.map($format_val_fn))) }}; @@ -95,21 +95,21 @@ macro_rules! fetch_all_rows_by_sqlx { ($pool:expr, $sql:expr, $key_scalar:expr, $val_type:ty, $format_key_fn:expr) => { match $key_scalar { DataType::Boolean => { - let res: Vec<(Option, Option<$val_type>)> = + let res: Vec<(bool, Option<$val_type>)> = sqlx::query_as($sql).fetch_all($pool).await?; res.into_iter() .filter_map(|(key, val)| match (key, val) { - (Some(k), Some(v)) => Some(($format_key_fn(ScalarRef::Boolean(k)), v)), + (k, Some(v)) => Some(($format_key_fn(ScalarRef::Boolean(k)), v)), _ => None, }) .collect() } DataType::String => { - let res: Vec<(Option, Option<$val_type>)> = + let res: Vec<(String, Option<$val_type>)> = sqlx::query_as($sql).fetch_all($pool).await?; res.into_iter() .filter_map(|(key, val)| match (key, val) { - (Some(k), Some(v)) => Some(($format_key_fn(ScalarRef::String(&k)), v)), + (k, Some(v)) => Some(($format_key_fn(ScalarRef::String(&k)), v)), _ => None, }) .collect() @@ -117,31 +117,31 @@ macro_rules! fetch_all_rows_by_sqlx { DataType::Number(num_ty) => { with_integer_mapped_type!(|NUM_TYPE| match num_ty { NumberDataType::NUM_TYPE => { - let res: Vec<(Option, Option<$val_type>)> = + let res: Vec<(NUM_TYPE, Option<$val_type>)> = sqlx::query_as($sql).fetch_all($pool).await?; res.into_iter() .filter_map(|(key, val)| match (key, val) { - (Some(k), Some(v)) => Some((format!("{}", k), v)), + (k, Some(v)) => Some((format!("{}", k), v)), _ => None, }) .collect() } NumberDataType::Float32 => { - let res: Vec<(Option, Option<$val_type>)> = + let res: Vec<(f32, Option<$val_type>)> = sqlx::query_as($sql).fetch_all($pool).await?; res.into_iter() .filter_map(|(key, val)| match (key, val) { - (Some(k), Some(v)) => Some((format!("{}", k), v)), + (k, Some(v)) => Some((format!("{}", k), v)), _ => None, }) .collect() } NumberDataType::Float64 => { - let res: Vec<(Option, Option<$val_type>)> = + let res: Vec<(f64, Option<$val_type>)> = sqlx::query_as($sql).fetch_all($pool).await?; res.into_iter() .filter_map(|(key, val)| match (key, val) { - (Some(k), Some(v)) => Some((format!("{}", k), v)), + (k, Some(v)) => Some((format!("{}", k), v)), _ => None, }) .collect()