diff --git a/src/frontend/src/binder/bind_context.rs b/src/frontend/src/binder/bind_context.rs index 003232b209e58..cb81b445f96e0 100644 --- a/src/frontend/src/binder/bind_context.rs +++ b/src/frontend/src/binder/bind_context.rs @@ -104,7 +104,7 @@ pub struct BindContext { pub clause: Option, // The `BindContext`'s data on its column groups pub column_group_context: ColumnGroupContext, - /// Map the cte's name to its `Relation::Subquery`. + /// Map the cte's name to its binding state. /// The `ShareId` of the value is used to help the planner identify the share plan. pub cte_to_relation: HashMap>>, /// Current lambda functions's arguments diff --git a/src/frontend/src/binder/query.rs b/src/frontend/src/binder/query.rs index 8a45550b056f5..c83d70cd9cf18 100644 --- a/src/frontend/src/binder/query.rs +++ b/src/frontend/src/binder/query.rs @@ -296,7 +296,7 @@ impl Binder { fetch, } = query; fn should_be_empty(v: Option, clause: &str) -> Result<()> { - if !v.is_none() { + if v.is_some() { return Err(ErrorCode::BindError(format!( "`{clause}` is not supported in recursive CTE" )) @@ -316,16 +316,16 @@ impl Binder { right, } = body else { - return Err(ErrorCode::BindError(format!( - "`UNION` is required in recursive CTE" - )) + return Err(ErrorCode::BindError( + "`UNION` is required in recursive CTE".to_string(), + ) .into()); }; if !all { - return Err(ErrorCode::BindError(format!( - "only `UNION ALL` is supported in recursive CTE now" - )) + return Err(ErrorCode::BindError( + "only `UNION ALL` is supported in recursive CTE now".to_string(), + ) .into()); } diff --git a/src/frontend/src/binder/relation/mod.rs b/src/frontend/src/binder/relation/mod.rs index de76d4e59d7b9..a70323add1322 100644 --- a/src/frontend/src/binder/relation/mod.rs +++ b/src/frontend/src/binder/relation/mod.rs @@ -362,7 +362,7 @@ impl Binder { match cte_state { BindingCteState::Init => { - Err(ErrorCode::BindError(format!("Base term of recursive CTE not found, consider write it to left side of the `UNION` operator")).into()) + Err(ErrorCode::BindError("Base term of recursive CTE not found, consider write it to left side of the `UNION` operator".to_string()).into()) } BindingCteState::BaseResolved { schema } => { self.bind_table_to_context( diff --git a/src/frontend/src/expr/mod.rs b/src/frontend/src/expr/mod.rs index 81fe3b77615cd..e6b2c0d382b90 100644 --- a/src/frontend/src/expr/mod.rs +++ b/src/frontend/src/expr/mod.rs @@ -483,9 +483,7 @@ impl ExprImpl { self.visit_bound_set_expr(left); self.visit_bound_set_expr(right); } - BoundSetExpr::RecursiveUnion { - base, recursive, - } => { + BoundSetExpr::RecursiveUnion { base, recursive } => { self.visit_bound_set_expr(base); self.visit_bound_set_expr(recursive); }