Skip to content

Commit 73814d2

Browse files
authored
refactor(binder): consolidate binder alias semantics and split type_check (#19750)
* refactor(ast): add leave hooks to visitor traversal * test(sql): add binder coverage for prebind edge cases * refactor(sql): streamline binder clause analysis * refactor(sql): add name-resolution normalize helper * refactor(sql): split semantic type checker internals * fix(sql): preserve GROUP BY alias resolution * fix(sql): narrow GROUP BY alias resolution * refactor(sql): consolidate binder alias facts * fix(sql): restore result cache state calls after merge * refine
1 parent b6cc285 commit 73814d2

40 files changed

Lines changed: 8207 additions & 7287 deletions

src/query/ast/src/visit.rs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ pub enum VisitControl<B = ()> {
9090

9191
pub type VisitResult = Result<VisitControl, !>;
9292

93-
/// Pre-order visitor hooks for immutable AST traversal.
93+
/// Visitor hooks for immutable AST traversal.
9494
///
9595
/// Returning `Continue` lets the walker descend into children automatically.
9696
/// Returning `SkipChildren` stops descent for the current node.
@@ -113,6 +113,10 @@ pub trait Visitor {
113113
Ok(VisitControl::Continue)
114114
}
115115

116+
fn leave_query(&mut self, _query: &Query) -> Result<(), Self::Error> {
117+
Ok(())
118+
}
119+
116120
fn visit_set_expr(
117121
&mut self,
118122
_set_expr: &SetExpr,
@@ -138,6 +142,10 @@ pub trait Visitor {
138142
Ok(VisitControl::Continue)
139143
}
140144

145+
fn leave_expr(&mut self, _expr: &Expr) -> Result<(), Self::Error> {
146+
Ok(())
147+
}
148+
141149
fn visit_function_call(
142150
&mut self,
143151
_call: &FunctionCall,
@@ -160,7 +168,7 @@ pub trait Visitor {
160168
}
161169
}
162170

163-
/// Pre-order visitor hooks for mutable AST traversal.
171+
/// Visitor hooks for mutable AST traversal.
164172
///
165173
/// Returning `Continue` lets the walker descend into children automatically.
166174
/// Returning `SkipChildren` stops descent for the current node.
@@ -186,6 +194,10 @@ pub trait VisitorMut {
186194
Ok(VisitControl::Continue)
187195
}
188196

197+
fn leave_query(&mut self, _query: &mut Query) -> Result<(), Self::Error> {
198+
Ok(())
199+
}
200+
189201
fn visit_set_expr(
190202
&mut self,
191203
_set_expr: &mut SetExpr,
@@ -211,6 +223,10 @@ pub trait VisitorMut {
211223
Ok(VisitControl::Continue)
212224
}
213225

226+
fn leave_expr(&mut self, _expr: &mut Expr) -> Result<(), Self::Error> {
227+
Ok(())
228+
}
229+
214230
fn visit_function_call(
215231
&mut self,
216232
_call: &mut FunctionCall,

0 commit comments

Comments
 (0)