Skip to content

Commit

Permalink
feat(stream): recognize no op update for table (#14358)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenzl25 authored Jan 5, 2024
1 parent 5a3d265 commit 17daad7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/stream/src/executor/mview/materialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,13 @@ fn generate_output(
new_rows.push(old_value);
}
KeyOp::Update((old_value, new_value)) => {
new_ops.push(Op::UpdateDelete);
new_ops.push(Op::UpdateInsert);
new_rows.push(old_value);
new_rows.push(new_value);
// if old_value == new_value, we don't need to emit updates to downstream.
if old_value != new_value {
new_ops.push(Op::UpdateDelete);
new_ops.push(Op::UpdateInsert);
new_rows.push(old_value);
new_rows.push(new_value);
}
}
}
}
Expand Down

0 comments on commit 17daad7

Please sign in to comment.