Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: TennyZhuang <[email protected]>
  • Loading branch information
TennyZhuang committed Mar 29, 2024
1 parent f8e3788 commit 76cc79c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/frontend/src/binder/bind_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ pub struct BindContext {
pub clause: Option<Clause>,
// 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<String, Rc<RefCell<(ShareId, BindingCteState, TableAlias)>>>,
/// Current lambda functions's arguments
Expand Down
14 changes: 7 additions & 7 deletions src/frontend/src/binder/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ impl Binder {
fetch,
} = query;
fn should_be_empty<T>(v: Option<T>, clause: &str) -> Result<()> {
if !v.is_none() {
if v.is_some() {
return Err(ErrorCode::BindError(format!(
"`{clause}` is not supported in recursive CTE"
))
Expand All @@ -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());
}

Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/binder/relation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 1 addition & 3 deletions src/frontend/src/expr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 76cc79c

Please sign in to comment.