Skip to content

Conversation

@jeffreyaven
Copy link
Member

…lity

Window functions (those with OVER clause) are computed expressions that should not be looked up in underlying tables or CTEs. By setting IsAggregateExpr = true for window functions, we allow them to bypass column resolution in indirect queries (CTEs, subqueries, views).

This fixes "cannot find col" errors when using window functions like RANK(), ROW_NUMBER(), SUM() OVER, etc. in queries that reference CTEs.

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

…lity

Window functions (those with OVER clause) are computed expressions that
should not be looked up in underlying tables or CTEs. By setting
IsAggregateExpr = true for window functions, we allow them to bypass
column resolution in indirect queries (CTEs, subqueries, views).

This fixes "cannot find col" errors when using window functions like
RANK(), ROW_NUMBER(), SUM() OVER, etc. in queries that reference CTEs.
@jeffreyaven jeffreyaven merged commit 196efb0 into main Dec 2, 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