You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
=> create table t (
tm timestamp,
foo int,
bar int,
watermark for tm as tm - interval '5 minutes'
) append only;
=> create materialized view mv asselect*,
max(foo) over (partition by bar order by tm range between current row and'10 minute' following) as m
from t
emit on window close;
=>insert into t values
('2023-05-06 16:51:00', 1, 100)
, ('2023-05-06 16:56:00', 8, 100)
, ('2023-05-06 17:30:00', 3, 200)
, ('2023-05-06 17:35:00', 5, 100)
, ('2023-05-06 17:59:00', 4, 100)
, ('2023-05-06 18:01:00', 6, 200)
;
=>select*from mv;
tm | foo | bar | m
---------------------+-----+-----+---2023-05-0616:51:00 | 1 | 100 | 82023-05-0616:56:00 | 8 | 100 | 8
(2 rows)
In the above example, when 17:59:00 and 18:01:00 are inserted, these two rows are not visible to OverWindow. What are visible to OverWindow are the first 4 rows. Now for 17:30:00 and 17:35:00 (belonging to partition 200 and 100 respectively), they don't know if there'll be future rows that are in their corresponding range window (e.g. [17:30:00, 17:40:00]), so they can't be outputted. However in fact, because of the existence of 18:01:00, OverWindow should've received the 17:56:00 watermark, indicating that there'll be no row before that in the future. So in fact the 17:30:00 and 17:35:00 can be outputted very safely.
This problem doesn't affect the correctness of the result. All rows will finally output correctly if the stream is healthy and all concerned partitions are being actively updated. But in the case that some partitions are seldomly updated, the result can be delayed for an indefinite long time.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Example:
In the above example, when
17:59:00
and18:01:00
are inserted, these two rows are not visible to OverWindow. What are visible to OverWindow are the first 4 rows. Now for17:30:00
and17:35:00
(belonging to partition200
and100
respectively), they don't know if there'll be future rows that are in their corresponding range window (e.g.[17:30:00, 17:40:00]
), so they can't be outputted. However in fact, because of the existence of18:01:00
, OverWindow should've received the17:56:00
watermark, indicating that there'll be no row before that in the future. So in fact the17:30:00
and17:35:00
can be outputted very safely.This problem doesn't affect the correctness of the result. All rows will finally output correctly if the stream is healthy and all concerned partitions are being actively updated. But in the case that some partitions are seldomly updated, the result can be delayed for an indefinite long time.
The text was updated successfully, but these errors were encountered: