docs: add window interval description (#33493)

This commit is contained in:
Pan Wei 2025-11-07 08:32:28 +08:00 committed by GitHub
parent 9f091b38e9
commit 4e194771cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -176,7 +176,7 @@ When using the window clause, the following rules should be observed:
### Timestamp Pseudocolumns
In the window aggregation query results, if the SQL does not specify the timestamp column in the output query results, the final results will not automatically include the time column information of the window. However, if you need to output the time window information corresponding to the aggregated query results in the results, you can use the timestamp-related pseudocolumns in the select clause, such as the start time of the time window (`_wstart`), the end time of the time window (`_wend`), the duration of the time window (`_wduration`), and the pseudocolumns related to the overall query window, such as the start time of the query window (`_qstart`) and the end time of the query window (`_qend`). Note that both the start and end times of the time window are closed intervals, and the duration of the time window is the value under the current time resolution of the data. For example, if the current database's time precision is milliseconds (ms), then 500 in the results represents the duration of the current time window is 500ms.
In the window aggregation query results, if the SQL does not specify the timestamp column in the output query results, the final results will not automatically include the time column information of the window. However, if you need to output the time window information corresponding to the aggregated query results in the results, you can use the timestamp-related pseudocolumns in the select clause, such as the start time of the time window (`_wstart`), the end time of the time window (`_wend`), the duration of the time window (`_wduration`), and the pseudocolumns related to the overall query window, such as the start time of the query window (`_qstart`) and the end time of the query window (`_qend`). It should be noted that, except that the end time of the INTERVAL window is an open interval, the start time and end time of other time windows are both closed intervals, and the duration of the time window is the value under the current time resolution of the data. For example, if the current database's time precision is milliseconds (ms), then 500 in the results represents the duration of the current time window is 500ms.
### Time Windows

View file

@ -173,7 +173,7 @@ window_clause: {
### 时间戳伪列
在窗口聚合查询结果中,如果 SQL 中没有指定输出查询结果中的时间戳列,那么最终结果中将不会自动包含窗口的时间列信息。然而,如果你需要在结果中输出聚合查询结果所对应的时间窗口信息,可以在 select 子句中使用与时间戳相关的伪列如时间窗口起始时间_wstart、时间窗口结束时间_wend、时间窗口持续时间_wduration以及与查询整体窗口相关的伪列如查询窗口起始时间_qstart和查询窗口结束时间_qend。需要注意的是时间窗口起始时间和结束时间均是闭区间时间窗口持续时间是数据当前时间分辨率下的数值。例如如果当前数据库的时间精度是毫秒ms那么结果中的 500 表示当前时间窗口的持续时间是 500ms。
在窗口聚合查询结果中,如果 SQL 中没有指定输出查询结果中的时间戳列,那么最终结果中将不会自动包含窗口的时间列信息。然而,如果你需要在结果中输出聚合查询结果所对应的时间窗口信息,可以在 select 子句中使用与时间戳相关的伪列如时间窗口起始时间_wstart、时间窗口结束时间_wend、时间窗口持续时间_wduration以及与查询整体窗口相关的伪列如查询窗口起始时间_qstart和查询窗口结束时间_qend。需要注意的是除 INTERVAL 窗口的结束时间为开区间外,其他时间窗口起始时间和结束时间均是闭区间时间窗口持续时间是数据当前时间分辨率下的数值。例如如果当前数据库的时间精度是毫秒ms那么结果中的 500 表示当前时间窗口的持续时间是 500ms。
### 时间窗口