snuyanzin commented on code in PR #24256:
URL: https://github.com/apache/flink/pull/24256#discussion_r1848638344
##########
flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/runtime/batch/sql/OverAggregateITCase.scala:
##########
@@ -532,6 +532,33 @@ class OverAggregateITCase extends BatchTestBase {
)
}
+ @Test
+ def testWindowAggregationSumWithQualify(): Unit = {
+ checkResult(
+ "SELECT d, e FROM Table5 QUALIFY sum(e) OVER (PARTITION BY d ORDER BY e)
> 20",
Review Comment:
added a test and changed the doc
one thing to clarify:
there are 2 options
1. the one you mentioned above
```sql
SELECT [column_list],
ROW_NUMBER() OVER ([PARTITION BY col1[, col2...]] ORDER BY time_attr
[asc|desc]) AS rownum
FROM table_name
QUALIFY rownum = 1
```
2. the second one is slightly different
```sql
SELECT [column_list]
FROM table_name
QUALIFY ROW_NUMBER() OVER ([PARTITION BY col1[, col2...]] ORDER BY
time_attr [asc|desc]) = 1
```
From one side we can use alias in first option from another side there will
be extra columns in projections
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]