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

Sort options for DataType::Dictionary is incorrect #4649

Open
mingmwang opened this issue Dec 15, 2022 · 1 comment
Open

Sort options for DataType::Dictionary is incorrect #4649

mingmwang opened this issue Dec 15, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@mingmwang
Copy link
Contributor

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
(This section helps Arrow developers understand the context and why for this feature, in addition to the what)

Looks like when the DataType is Dictionary, it always reset the Nulls First settings and ignore the sort option from the query engine. This will generate wrong sort result. I will add a UT to reproduce the issue.

https://github.com/apache/arrow-rs/blob/a0a5880665b1836890f6843b6b8772d81c463351/arrow-ord/src/sort.rs#L316-L332

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@mingmwang mingmwang added the enhancement New feature or request label Dec 15, 2022
@tustvold
Copy link
Contributor

The logic you link to is fairly well tested - https://github.com/apache/arrow-rs/blob/a0a5880665b1836890f6843b6b8772d81c463351/arrow-ord/src/sort.rs#L2998

There is, however, a known issue with lexsort's handling of nested nulls in dictionaries - apache/arrow-rs#2687 although again it should be noted that arrow-rs will not generate such arrays naturally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants