-
Notifications
You must be signed in to change notification settings - Fork 700
fix(streaming): fix index's stream key to include distribution key #23592
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
Conversation
| .map(|index| i2o.try_map(index)) | ||
| .collect::<Option<Vec<_>>>()?; |
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.
The derivation of join keys logic is changed. We apply the i2o mapping at the end. Otherwise, index selection for streaming join might panic, because index selection will replace a primary table with an index. Before this PR, they will have the same stream keys, but after this PR, they have different stream keys. For other operator like Agg, TopN, we can safely replace it with indexes, because the index stream_key's existence can always be guaranteed after logical_rewrite_for_stream. However, for the join, we only keep one side of the join key as the join's stream_key, and the other side's join key could be removed (even if it is the stream_key of the index).
The e2e test failed, because it is possible that ExchangeExecutor passes through the U-/U+ to a same actor if the vnode of the distribution key calculation is the same even though the distribution key is changed. But Exchange's distribution key should be part of the stream key of the downstream executor. It means we need to change U-/U+ to D-/I+ in ExchangeExecutor when the columns of distribution key are changed instead of doing these changes when vnode are different. |
waiting for #23603 |
6f66aef to
9629294
Compare
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!
…is the subset of the locality columns

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
stream_key()to the table catalog, so that we can always include the distribution keys to the stream keys. We should never use the stream_key field directly, instead we should use thestream_key()method in the future.Checklist
Documentation
Release note