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

Fix List Sorting, Revert Removal of Rank Kernels #4747

Merged
merged 4 commits into from
Sep 5, 2023

Conversation

tustvold
Copy link
Contributor

Which issue does this PR close?

Closes #4746

Rationale for this change

Reverts #4703 and uses this to fix #4746

What changes are included in this PR?

Are there any user-facing changes?

@github-actions github-actions bot added the arrow Changes to the arrow crate label Aug 29, 2023
out[*val as usize] = ix as u32;
}
Ok(out)
rank(values, value_options)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the fix for #4746

The issue is caused by the previous logic assigning distinct ranks to equal values. This was fine when used for dictionaries, as it just made the sort less stable, but the changes in #4613 used the same logic for the lexicographic style comparison for lists, which made this incorrect

Copy link
Contributor

@crepererum crepererum left a comment

Choose a reason for hiding this comment

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

I think I get the gist of this. However sort.rs is very hard to review. Core methods aren't documented (esp. their parameters, like what is valids and why is it a combination of T and a u32? sort_impl for example has 5 parameters), the approach of ranking child values and using these ranks for the actual sorting is also quite implicit (but actually important to understand for this very bug).

@tustvold tustvold merged commit db5314c into apache:master Sep 5, 2023
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression: Incorrect Sorting of *ListArray in 46.0.0
3 participants