Skip to content

Commit ee69fcc

Browse files
git-hulkclaude
andauthored
Fix Walk logic for DistinctOn clause (#195)
Add support for walking DistinctOn AST nodes in the Walk function to ensure proper traversal of SELECT DISTINCT ON expressions. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <[email protected]>
1 parent b8659ca commit ee69fcc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

parser/walk.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ func Walk(node Expr, fn WalkFunc) bool {
2222
if !Walk(n.With, fn) {
2323
return false
2424
}
25+
if !Walk(n.DistinctOn, fn) {
26+
return false
27+
}
2528
if !Walk(n.Top, fn) {
2629
return false
2730
}
@@ -1421,6 +1424,12 @@ func Walk(node Expr, fn WalkFunc) bool {
14211424
if !Walk(n.Target, fn) {
14221425
return false
14231426
}
1427+
case *DistinctOn:
1428+
for _, ident := range n.Idents {
1429+
if !Walk(ident, fn) {
1430+
return false
1431+
}
1432+
}
14241433
}
14251434
return true
14261435
}

0 commit comments

Comments
 (0)