-
Notifications
You must be signed in to change notification settings - Fork 589
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(stream): support non-append-only process time temporal join #16286
Conversation
This looks good. Correct me if I'm wrong: we face the exactly same issue with indeterministic UDFs. Is it possible to make the memoization(materialization) into a separate operator? So that we can reuse it for these similar cases. |
There should be an abstraction for the logic, but IMO it shouldn’t be a separate operator. |
Even though indeterministic UDFs also need a memo table, I don't think we can use a shared operator to handle both cases. Because the memo table access pattern and the way how to reconstruct rows from the memo table are totally different. |
You're right. I was solely focused on using temporal join for point-lookup. 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, maybe we can notice user their will be a memo table state for non-append-only temporal join to prevent silently generating a stream plan with bad performance.(One case I can come up with is #13549)
// The null rows generated by outer join and the other condition somehow is a stateless operation which means we can handle them without the memo table. | ||
let memo_table = memo_table.as_mut().unwrap(); | ||
match op { | ||
Op::Insert | Op::UpdateInsert => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to handle the case that a row is updated while the join key is not changed. This can be done in a separate PR, but overall I think it's a must-have enhancement
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
memo_table
to the temporal join.memo_table
's pk isjoin_key
+left_pk
+right_pk
. And its columns are almost the same as the right table.for each left input row (with insert op), construct the memo table pk and insert the row.
Read pattern:
for each left input row (with delete op), construct pk prefix (
join_key
+left_pk
) to fetch rows.Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.