Skip to content

Conversation

@jeffreyaven
Copy link
Member

…essions

  • Add BinaryExpr case in inferColNameFromExpr to handle arithmetic expressions like "100.0 * contributions / SUM(...)"
  • BinaryExpr checks if either operand is an aggregate/window expression and propagates IsAggregateExpr status
  • Multi-argument functions now propagate IsAggregateExpr from their arguments, so ROUND(expr_with_window_func, 2) is correctly marked

This fixes "cannot find col" errors when using complex expressions containing window functions in CTE queries.

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

…essions

- Add BinaryExpr case in inferColNameFromExpr to handle arithmetic
  expressions like "100.0 * contributions / SUM(...)"
- BinaryExpr checks if either operand is an aggregate/window expression
  and propagates IsAggregateExpr status
- Multi-argument functions now propagate IsAggregateExpr from their
  arguments, so ROUND(expr_with_window_func, 2) is correctly marked

This fixes "cannot find col" errors when using complex expressions
containing window functions in CTE queries.
@jeffreyaven jeffreyaven merged commit b2c9b88 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