-
Notifications
You must be signed in to change notification settings - Fork 597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(binder): correctly bind rcte in bind_with
& bind_relation_by_name
#16023
Changes from 12 commits
24b7e4d
c7c4489
5e7cd1c
fb8fe85
89580d3
78e5841
d6ea53d
d7c0931
3fc27bf
7b4b3d3
9870b10
4b00693
2bccdce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright 2024 RisingWave Labs | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
use crate::binder::statement::RewriteExprsRecursive; | ||
use crate::binder::BoundSetExpr; | ||
|
||
/// a *bound* recursive union representation. | ||
#[allow(dead_code)] | ||
#[derive(Debug, Clone)] | ||
pub struct BoundRecursiveUnion { | ||
/// the *bound* base case | ||
pub(crate) base: BoundSetExpr, | ||
/// the *bound* recursive case | ||
pub(crate) recursive: BoundSetExpr, | ||
} | ||
|
||
impl RewriteExprsRecursive for BoundRecursiveUnion { | ||
fn rewrite_exprs_recursive(&mut self, _rewriter: &mut impl crate::expr::ExprRewriter) {} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The implementation seems should be blanket? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The operator should be similar to BoundSetExpr, but not BoundBackRef There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated - now we will rewrite the two |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the special check here, is because the lateral context typically contains the same stuff of the new bound context, when binding the final statement for a rcte - that's why we don't what to return error for the case like this.
ps. need further review, cc @chenzl25 @TennyZhuang.
pss. I'll merge this pr first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated here: #16282