-
Notifications
You must be signed in to change notification settings - Fork 593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: an append-only materialized view storing continuous timestamps #15830
Comments
Can this just be expressed with create materialized view xxx as generate_series(
'2020-01-01 00:00:00'::TIMESTAMP, -- start
NOW(), -- end
interval '1' minute -- step
); Internally, |
The issue is that it will generate too many data in the table and also it is a big generate_series batch query. |
Didn't get this. Can you explain it? I don't see any batch query here. By the way, regarding the original query in PR description
Do you mean |
Oh, create mv with a
WIth this query, every time the now()'s value changes, RW will retract all the result of the old TVF |
Yes, I will change it. |
Yeah, by the current implementation, it is. I am just proposing to use the syntax. We should make it incremental internally. |
Ohh so sorry I misunderstand it ... LGTM to use the syntax.
|
By the way, share the Compared with
Regarding of the user interface, I slightly prefer this than |
So, Even a streaming |
Let me explain why a (naive) outer join is not the optimal approach. For example, let's consider the hardest case first - the only left row in a time window was deleted, in this case, a gap is created, and we need to fill the gap with a row of No matter which approach we are using, to implement this, the operator must memorize how many rows were in this window before the -- imagine it as
upstream_data LEFT OUTER JOIN per_minutes_series However, the rest state tables, such as the materialized rows of both left & right sides, were useless, because
I am thinking that we might need to introduce a special operator, saying, like a much simplified outer join operator with a degree table. Of course, this can be a second step and naive |
dolphinDB allow a
https://docs.dolphindb.cn/en/help/SQLStatements/interval.html |
Interesting. While for RisingWave, the closest syntax is actually the time window function i.e. |
Oh, I just realized the discussion around gap filling and interpolation has been a little bit off-topic. Let's focus on the original requirement for this issue. That is, supporting
with some efficient incremental way. |
background
In some use cases, users want a timed triggering logic and they like to do it like this
The view timer_per_minutes will emit the event per minute periodically.
RW can support this kind of usage with a more friendly syntax with a TVF
timer_source(interval: INTERVAL) -> APPEND ONLY STREAM (time: timestamptz);
. Also, RW can do more optimization for this case and save the big time list table.implementation
It is a flag on the NowExecutor. And it should not associate with the barrier interval. Even when barrier interval is 10s and the timer's interval is 1s, it should emit the time for each 1s.
The text was updated successfully, but these errors were encountered: