Skip to content

Conversation

@jeffreyaven
Copy link
Member

Description

Type of change

  • Bug fix (non-breaking change to fix a bug).
  • Feature (non-breaking change to add functionality).
  • Breaking change.
  • Other (eg: documentation change). Please explain.

Issues referenced.

Evidence

Checklist:

  • A full round of testing has been completed, and there are no test failures as a result of these changes.
  • The changes are covered with functional and/or integration robot testing.
  • The changes work on all supported platforms.
  • Unit tests pass locally, as per the developer guide.
  • Robot tests pass locally, as per the developer guide.
  • Linter passes locally, as per the developer guide.

Variations

Tech Debt

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.
@jeffreyaven jeffreyaven merged commit 407ceaf into main Dec 1, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants