Repository navigation
Commit 16c0755
authored
Resolve named windows in HAVING (apache#26515)
## Which issue does this PR close?
- Closes apache#26506.
## Rationale for this change
A named window in `HAVING` was never resolved, so `MAX(price) OVER w`
was planned as a plain aggregate and the query returned rows instead of
being rejected. An undefined window name in `HAVING` was not reported
either.
## What changes are included in this PR?
Resolve named windows in `HAVING` together with the other clauses. The
query now fails like the inline form (`Window function calls are not
allowed in HAVING`), and an undefined name reports `The window ... is
not defined!`.
This builds on apache#26400, which makes the resolver usable for any clause.
Only the last commit is new; the diff shrinks to it once apache#26400 merges.
## Are these changes tested?
Yes, `window.slt` cases for `HAVING` (inline, named, undefined name) and
`WHERE` (inline, named). The `HAVING` cases fail without the fix.
## Are there any user-facing changes?
Queries that used a named window in `HAVING` now return an error instead
of wrong results.1 parent 9504942 commit 16c0755
2 files changed
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3629 | 3629 | | |
3630 | 3630 | | |
3631 | 3631 | | |
| 3632 | + | |
| 3633 | + | |
| 3634 | + | |
| 3635 | + | |
| 3636 | + | |
| 3637 | + | |
| 3638 | + | |
| 3639 | + | |
| 3640 | + | |
| 3641 | + | |
| 3642 | + | |
| 3643 | + | |
| 3644 | + | |
| 3645 | + | |
| 3646 | + | |
| 3647 | + | |
| 3648 | + | |
| 3649 | + | |
| 3650 | + | |
| 3651 | + | |
| 3652 | + | |
| 3653 | + | |
| 3654 | + | |
| 3655 | + | |
3632 | 3656 | | |
3633 | 3657 | | |
3634 | 3658 | | |
| |||
0 commit comments