Skip to content
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(storage): add support composite sort key in MergeIterator #622

Merged

Conversation

BaymaxHWY
Copy link
Contributor

Signed-off-by: BaymaxHWY 854541526@qq.com
close issue: #588

Signed-off-by: BaymaxHWY <854541526@qq.com>
@skyzh skyzh self-requested a review April 12, 2022 08:59
Copy link
Member

@skyzh skyzh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, good work! The implementation is so precise and concise :)

// TODO: handle can-not-compare
res = left_data.partial_cmp(&right_data).unwrap();
if Ordering::Equal != res {
break;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just return res here? so that res can simply be a local variable

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

for sort_key_idx in &self.sort_key_idx {
let left_data = self.chunk_buffer[*left_id]
.as_ref()
.unwrap()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we move this unwrap to the outer loop, so that we can do less conditional branch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get it!

@skyzh skyzh changed the title add support composite sort key in MergeIterator feat(storage): add support composite sort key in MergeIterator Apr 12, 2022
Signed-off-by: BaymaxHWY <854541526@qq.com>
@skyzh skyzh enabled auto-merge (squash) April 13, 2022 02:16
@skyzh skyzh merged commit bcbe568 into risinglightdb:main Apr 13, 2022
@BaymaxHWY BaymaxHWY deleted the storage/composite_sort_key_MergeIterator branch April 13, 2022 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants