Claude/fix window function execution 01 wb dt4 a6k m pz l5 k jm lwahbu#114
Merged
jeffreyaven merged 3 commits intoDec 1, 2025
Merged
Conversation
The FuncExpr cases in astvisit files were manually constructing function output but not including the OVER clause, causing argument-less window functions like ROW_NUMBER() and RANK() to fail with "misuse of window function" errors.
…ause The inferColNameFromExpr function was manually constructing the decorated column for functions with 0 or 2+ arguments using fmt.Sprintf, which did not include the OVER clause for window functions like ROW_NUMBER(), RANK(), etc. Changed to use astformat.String(expr, formatter) which properly calls FuncExpr.Format() and includes the OVER clause.
The previous change broke json_extract and other multi-argument functions because astformat.String doesn't apply the same recursive processing to arguments that the manual construction does. Now only use astformat.String when expr.Over != nil (actual window functions), keeping the original fmt.Sprintf behavior for regular functions to maintain proper argument decoration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Type of change
Issues referenced.
Evidence
Checklist:
Variations
Tech Debt