Skip to content

Commit

Permalink
state time window
Browse files Browse the repository at this point in the history
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
  • Loading branch information
waynexia committed May 16, 2024
1 parent 401480c commit 1f55d58
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Define Time Window

Time window is an important attribute of your continuous aggregation query. It defines how the data is aggregated in the flow. GreptimeDB provides two types of time windows: `hop` and `tumble`, or "sliding window" and "fixed window" in other words. You can specify the time window in the `GROUP BY` clause using `hop()` function or `tumble()` function respectively.
Time window is an important attribute of your continuous aggregation query. It defines how the data is aggregated in the flow. GreptimeDB provides two types of time windows: `hop` and `tumble`, or "sliding window" and "fixed window" in other words. You can specify the time window in the `GROUP BY` clause using `hop()` function or `tumble()` function respectively. These two functions are only supported in continuous aggregate queries's `GROUP BY` position.

# Tumble

Expand All @@ -14,7 +14,7 @@ Where `col` specifies use which column to compute the time window. The provided

`start_time` is an optional parameter to specify the start time of the first window. If not provided, the start time will be aligned to calender.

# Hop
# Hop (not supported yet)

`hop` defines sliding window that moves forward by a fixed interval. It signature is like the following:

Expand All @@ -24,6 +24,6 @@ hop(col, size_interval, hop_interval, <start_time>)

Where `col` specifies use which column to compute the time window. The provided column must have a timestamp type.

`size_interval` specifies the size of each window, while `hop_interval` specifies the delta interval between windows' start timestamp. You can think the `tumble()` function as a special case of `hop()` function where the `size_interval` and `hop_interval` are the same.
`size_interval` specifies the size of each window, while `hop_interval` specifies the delta between two windows' start timestamp. You can think the `tumble()` function as a special case of `hop()` function where the `size_interval` and `hop_interval` are the same.

`start_time` is an optional parameter to specify the start time of the first window. If not provided, the start time will be aligned to calender.

0 comments on commit 1f55d58

Please sign in to comment.