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

take_run improvements #3701

Closed
askoa opened this issue Feb 12, 2023 · 1 comment · Fixed by #3705
Closed

take_run improvements #3701

askoa opened this issue Feb 12, 2023 · 1 comment · Fixed by #3705
Labels
arrow Changes to the arrow crate enhancement Any new improvement worthy of a entry in the changelog

Comments

@askoa
Copy link
Contributor

askoa commented Feb 12, 2023

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
The current implementation of take_run only handles PrimitiveArray. Also, it's slow as it compares the values. Extending the current approach to String and Binary values will make the solution much slower.

Describe the solution you'd like
Instead of run encoding taken values, we can run encode taken physical indices. This will be significantly faster for String and Binary values as we will avoid comparing values. The drawback of this approach is that in certain scenarios the output might not be efficiently run encoded. For e.g. given a RunArray { run_ends=[2,4,6,8], values=[1,2,1,2] } and take indices [2,3,6,7], the output will be RunArray { run_ends=[2,4], values=[2,2] } rather than RunArray { run_ends=[4], values=[2] }

Describe alternatives you've considered
We continue with the current approach of comparing values which, in creation scenarios, will result in efficient run encoded array at the cost of performance.

Additional context
#3622 (comment)

@askoa askoa added the enhancement Any new improvement worthy of a entry in the changelog label Feb 12, 2023
@tustvold tustvold added the arrow Changes to the arrow crate label Feb 24, 2023
@tustvold
Copy link
Contributor

label_issue.py automatically added labels {'arrow'} from #3705

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 enhancement Any new improvement worthy of a entry in the changelog
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants