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

storage: support composite sort key in MergeIterator #588

Closed
Tracked by #572
skyzh opened this issue Mar 27, 2022 · 2 comments
Closed
Tracked by #572

storage: support composite sort key in MergeIterator #588

skyzh opened this issue Mar 27, 2022 · 2 comments
Assignees

Comments

@skyzh
Copy link
Member

skyzh commented Mar 27, 2022

Currently, MergeIterator only supports taking a single sort_idx as parameter:

impl MergeIterator {
pub fn new(iters: Vec<SecondaryIterator>, sort_key_idx: usize) -> Self {
Self {

We should make MergeIterator be able to accept a vector of sort_idx. For example, sort_key_idx = [2, 1, 0]:

  • Implies that the child iterators are already being sorted using 3 columns: firstly be column #2, then by column #1, at last by #0.
    *MergeIterator should also sort by this rule.
pub fn new(iters: Vec<SecondaryIterator>, sort_key_idx: Vec<usize>) -> Self {

After we finish the refactor in the storage layer, we can firstly make all places to pass vec![sort_key] instead of sort_key. Then, we can refactor little by little to support full composite sort key support across our system.

@BaymaxHWY
Copy link
Contributor

Hi, can i try this? This requirement just changes the code about sort_key_idx and the function compare_data()?

@skyzh
Copy link
Member Author

skyzh commented Apr 12, 2022

Hi, can i try this? This requirement just changes the code about sort_key_idx and the function compare_data()?

Yes, I think so.

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

No branches or pull requests

2 participants