Huib
01/30/2024, 6:59 PMselect
l.id,
(
select
count(*)
from other_tbl
where start >= l.start
and end <= l.end
) as nr_events
from tbl as l
where nr_events is not null
without receiving an update per matching row in other_tbl?
I am aggregating, so I’d expect only a single row, but instead I’d see something like:
+I 1 0
-U 1 0
+U 1 1
-U 1 1
+U 1 2
-U 1 2
+U 1 3
-U 1 3
+U 1 4
etc etc
Watermarks are only of limited use, because the right side gets updated once a day, and contains values for future times - meaning there isn’t a single timestamp I can use to say: “we are here”, without introducing a 1-day-delayHuib
01/30/2024, 7:02 PMTim Wolfe
01/30/2024, 7:46 PMHuib
01/30/2024, 7:48 PMjson_arrayagg(json_object()) call to fetch the relevant data from another table)Huib
01/30/2024, 7:55 PMPedro Mázala
01/31/2024, 9:14 PMHuib
01/31/2024, 9:24 PMHuib
01/31/2024, 9:27 PMPedro Mázala
02/01/2024, 3:56 PMHuib
02/01/2024, 4:12 PMselect
id,
(
select agg() from tbl for system_time as of l.rowtime
where tbl.id = l.id
and tbl.field > l.field
)
from some_tbl as l