LadyForest commented on code in PR #24250:
URL: https://github.com/apache/flink/pull/24250#discussion_r1477163654
##########
docs/content.zh/docs/dev/table/sql/queries/window-agg.md:
##########
@@ -124,12 +142,12 @@ Flink SQL> SELECT window_start, window_end, SUM(price)
`GROUPING SETS` 窗口聚合中 `GROUP BY` 子句必须包含 `window_start` 和 `window_end` 列,但
`GROUPING SETS` 子句中不能包含这两个字段。
```sql
-Flink SQL> SELECT window_start, window_end, supplier_id, SUM(price) as price
+Flink SQL> SELECT window_start, window_end, supplier_id, SUM(price) AS total
Review Comment:
Nit: since you've modified the alias name, how about to align them as
"total_price"?
##########
docs/content.zh/docs/dev/table/sql/queries/window-agg.md:
##########
@@ -113,6 +117,20 @@ Flink SQL> SELECT window_start, window_end, SUM(price)
| 2020-04-15 08:10 | 2020-04-15 08:18 | 10.00 |
| 2020-04-15 08:10 | 2020-04-15 08:20 | 10.00 |
+------------------+------------------+-------+
+
+-- session window aggregation
Review Comment:
Nit: how about adding another example to illustrate the condition where no
"PARTITION BY" is used?
##########
docs/content/docs/dev/table/sql/queries/window-tvf.md:
##########
@@ -289,6 +289,100 @@ Here is an example invocation on the Bid table:
+------------------+------------------+-------+
```
+### SESSION
+
+{{< hint info >}}
+Note:
+1. Session Window TVF is not supported in Batch mode now.
+2. Session Window Aggregation is not supported [Performance Tuning]({{< ref
"docs/dev/table/tuning" >}}) now.
Review Comment:
```suggestion
2. Session Window Aggregation is not supported by local-global optimization.
You can refer to [Performance Tuning]({{< ref "docs/dev/table/tuning" >}}) for
more details.
```
##########
docs/content/docs/dev/table/sql/queries/window-agg.md:
##########
@@ -40,11 +40,15 @@ Unlike other aggregations on continuous tables, window
aggregation do not emit i
### Windowing TVFs
-Flink supports `TUMBLE`, `HOP` and `CUMULATE` types of window aggregations.
+Flink supports `TUMBLE`, `HOP`, `CUMULATE` and `SESSION` types of window
aggregations.
In streaming mode, the time attribute field of a window table-valued function
must be on either [event or processing time attributes]({{< ref
"docs/dev/table/concepts/time_attributes" >}}). See [Windowing TVF]({{< ref
"docs/dev/table/sql/queries/window-tvf" >}}) for more windowing functions
information.
In batch mode, the time attribute field of a window table-valued function must
be an attribute of type `TIMESTAMP` or `TIMESTAMP_LTZ`.
-Here are some examples for `TUMBLE`, `HOP` and `CUMULATE` window aggregations.
+{{< hint info >}}
+Note: `SESSION` Window Aggregation is not supported in Batch mode now.
Review Comment:
Nit: batch mode
##########
docs/content/docs/dev/table/sql/queries/window-tvf.md:
##########
@@ -289,6 +289,100 @@ Here is an example invocation on the Bid table:
+------------------+------------------+-------+
```
+### SESSION
+
+{{< hint info >}}
+Note:
+1. Session Window TVF is not supported in Batch mode now.
+2. Session Window Aggregation is not supported [Performance Tuning]({{< ref
"docs/dev/table/tuning" >}}) now.
+3. Session Window Join, Session Window TopN and Session Window Deduplication
are in experimental phase now.
Review Comment:
What do you mean by experimental?
##########
docs/content.zh/docs/dev/table/sql/queries/window-tvf.md:
##########
@@ -289,6 +289,99 @@ CUMULATE(TABLE data, DESCRIPTOR(timecol), step, size)
+------------------+------------------+-------+
```
+### 会话窗口(SESSION)
+
+{{< hint info >}}
+注意:
+1. 会话窗口函数目前不支持批模式。
+2. 会话窗口函数目前不支持[性能调优]({{< ref "docs/dev/table/tuning" >}})。
+3. 会话窗口Join、会话窗口Top-N、会话窗口聚合功能目前处于实验阶段。
+{{< /hint >}}
+
+会话窗口函数通过会话活动对元素进行分组。与滚动窗口和滑动窗口不同,会话窗口不重叠,也没有固定的开始和结束时间。
+一个会话窗口会在一定时间内没有收到元素时关闭,比如超过一定时间不处于活跃状态。
+会话窗口需要配置一个固定的会话间隙,以定义不活跃间隙的时长。
+当超出不活跃间隙的时候,当前的会话窗口将会关闭,随后的元素将被分配到一个新的会话窗口内。
+
+比如,定义一个不活跃间隙时长为10分钟的会话窗口。
Review Comment:
ditto
##########
docs/content.zh/docs/dev/table/sql/queries/window-tvf.md:
##########
@@ -289,6 +289,99 @@ CUMULATE(TABLE data, DESCRIPTOR(timecol), step, size)
+------------------+------------------+-------+
```
+### 会话窗口(SESSION)
+
+{{< hint info >}}
+注意:
+1. 会话窗口函数目前不支持批模式。
+2. 会话窗口函数目前不支持[性能调优]({{< ref "docs/dev/table/tuning" >}})。
+3. 会话窗口Join、会话窗口Top-N、会话窗口聚合功能目前处于实验阶段。
Review Comment:
ditto.
##########
docs/content.zh/docs/dev/table/sql/queries/window-tvf.md:
##########
@@ -30,10 +30,10 @@ under the License.
Apache Flink 提供了如下 `窗口表值函数`(table-valued function, 缩写TVF)把表的数据划分到窗口中:
-- [滚动窗口](#tumble)
-- [滑动窗口](#hop)
-- [累积窗口](#cumulate)
-- 会话窗口 (即将支持)
+- [滚动窗口](#滚动窗口tumble)
+- [滑动窗口](#滑动窗口hop)
+- [累积窗口](#累积窗口cumulate)
+- [会话窗口](#会话窗口session) (目前仅支持流模式)
Review Comment:
Nit: according to the Chinese doc standard, there should be one whitespace
between Chinese vs. English characters
--
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]