mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
fix window view docs
This commit is contained in:
parent
5b06e30ea2
commit
b74af1af5d
@ -296,7 +296,7 @@ CREATE WINDOW VIEW test.wv TO test.dst WATERMARK=ASCENDING ALLOWED_LATENESS=INTE
|
||||
|
||||
Note that elements emitted by a late firing should be treated as updated results of a previous computation. Instead of firing at the end of windows, the window view will fire immediately when the late event arrives. Thus, it will result in multiple outputs for the same window. Users need to take these duplicated results into account or deduplicate them.
|
||||
|
||||
### Monitoring New Windows{#window-view-monitoring}
|
||||
### Monitoring New Windows {#window-view-monitoring}
|
||||
|
||||
Window view supports the `WATCH` query to constantly append the processing results to the console or use `TO` syntax to output the results to a table.
|
||||
|
||||
|
@ -3,7 +3,7 @@ toc_priority: 68
|
||||
toc_title: Window View
|
||||
---
|
||||
|
||||
# Window View 函数{#window-view-han-shu}
|
||||
# Window View 函数 {#window-view-han-shu}
|
||||
|
||||
Window view函数用于获取窗口的起始(包含边界)和结束时间(不包含边界)。系统支持的window view函数如下:
|
||||
|
||||
|
@ -257,11 +257,11 @@ Window view可以通过时间窗口聚合数据,并在满足窗口触发条件
|
||||
|
||||
创建window view的方式和创建物化视图类似。Window view使用默认为`AggregatingMergeTree`的内部存储引擎存储计算中间状态。
|
||||
|
||||
### Window View 函数{#window-view-han-shu}
|
||||
### Window View 函数 {#window-view-han-shu}
|
||||
|
||||
[Window view函数](../../functions/window-view-functions.md)用于获取窗口的起始和结束时间。Window view需要和window view函数配合使用。
|
||||
|
||||
### 时间属性{#window-view-shi-jian-shu-xing}
|
||||
### 时间属性 {#window-view-shi-jian-shu-xing}
|
||||
|
||||
Window view 支持**处理时间**和**事件时间**两种时间类型。
|
||||
|
||||
@ -295,7 +295,7 @@ CREATE WINDOW VIEW test.wv TO test.dst WATERMARK=ASCENDING ALLOWED_LATENESS=INTE
|
||||
|
||||
需要注意的是,迟到消息需要更新之前的处理结果。与在窗口结束时触发不同,迟到消息到达时window view会立即触发计算。因此,会导致同一个窗口输出多次计算结果。用户需要注意这种情况,并消除重复结果。
|
||||
|
||||
### 新窗口监控{#window-view-xin-chuang-kou-jian-kong}
|
||||
### 新窗口监控 {#window-view-xin-chuang-kou-jian-kong}
|
||||
|
||||
Window view可以通过`WATCH`语句将处理结果推送至终端,或通过`TO`语句将结果推送至数据表。
|
||||
|
||||
@ -305,12 +305,12 @@ WATCH [db.]name [LIMIT n]
|
||||
|
||||
`WATCH`语句和`LIVE VIEW`中的类似。支持设置`LIMIT`参数,输出消息数目达到`LIMIT`限制时结束查询。
|
||||
|
||||
### 设置{#window-view-she-zhi}
|
||||
### 设置 {#window-view-she-zhi}
|
||||
|
||||
- `window_view_clean_interval`: window view清除过期数据间隔(单位为秒)。系统会定期清除过期数据,尚未触发的窗口数据不会被清除。
|
||||
- `window_view_heartbeat_interval`: 用于判断watch查询活跃的心跳时间间隔。
|
||||
|
||||
### 示例{#window-view-shi-li}
|
||||
### 示例 {#window-view-shi-li}
|
||||
|
||||
假设我们需要每10秒统计一次`data`表中的点击日志,且`data`表的结构如下:
|
||||
|
||||
@ -352,7 +352,7 @@ CREATE WINDOW VIEW wv TO dst AS SELECT count(id), tumbleStart(w_id) as window_st
|
||||
|
||||
ClickHouse测试中提供了更多的示例(以`*window_view*`命名)。
|
||||
|
||||
### Window View 使用场景{#window-view-shi-yong-chang-jing}
|
||||
### Window View 使用场景 {#window-view-shi-yong-chang-jing}
|
||||
|
||||
Window view 在以下场景有用:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user