-
Notifications
You must be signed in to change notification settings - Fork 590
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: compact_noop_update_after_outer_join #17568
Conversation
When Also, the side effect of making |
This PR will not buffer the chunks, instead, it will only do compact in each chunk.
I still think the |
Hmmm, I think the problem #17450 never happen in one chunk. It's shown in your example: https://github.com/risingwavelabs/risingwave/pull/17449/files |
I am just realize that we can just compact the output chunk to solve the issue.
will be
|
pub fn post_process(c: StreamChunk) -> StreamChunk { | ||
let mut c = StreamChunkMut::from(c); | ||
|
||
// NOTE(st1page): remove the pattern `UpdateDel(k, old), UpdateIns(k, NULL), UpdateDel(k, NULL), UpdateIns(k, new)` | ||
// to avoid this issue <https://github.com/risingwavelabs/risingwave/issues/17450> | ||
let mut i = 1; | ||
while i < c.capacity() { | ||
if c.op(i - 1) == Op::UpdateInsert | ||
&& c.op(i) == Op::UpdateDelete | ||
&& c.row_ref(i) == c.row_ref(i - 1) | ||
{ | ||
c.set_op(i - 2, Op::Delete); | ||
c.set_vis(i - 1, false); | ||
c.set_vis(i, false); | ||
c.set_op(i + 1, Op::Insert); | ||
i += 3; | ||
} else { | ||
i += 1; | ||
} | ||
} | ||
c.into() | ||
} |
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.
A less intrusive and lower overhead approach, PTAL again when you have time @fuyufjh .
pub fn post_process(c: StreamChunk) -> StreamChunk { | ||
let mut c = StreamChunkMut::from(c); |
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.
Please add some comment about this.
Also is it possible to add this in append_row_matched
etc.
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.
only do it on the JoinChunkBuilder
but not for the JoinStreamChunkBuilder
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.
Why not adding comments :(
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 forgot. 😶🌫️
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
to solve #17450
use the SQL to test if is takes effect.
before
after
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.