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

migrate partition kernel to use Iterator trait #437

Closed
jimexist opened this issue Jun 9, 2021 · 0 comments · Fixed by #438
Closed

migrate partition kernel to use Iterator trait #437

jimexist opened this issue Jun 9, 2021 · 0 comments · Fixed by #438
Labels
api-change Changes to the arrow API arrow Changes to the arrow crate

Comments

@jimexist
Copy link
Member

jimexist commented Jun 9, 2021

It should be possible to write the below as an iterator, thereby avoiding the allocation of the vector.

The general idea: create a struct with a method try_new. That method initializes the struct's content and errors if something is wrong (e.g. empty columns). It also initializes lexicographical_comparator.

Next, implement Iterator<Item=usize> for that struct where Iterator::next yields previous_partition_point and increments it as written in this function.

Originally posted by @jorgecarleitao in #424 (comment)

@jimexist jimexist changed the title migrate partition kernel to use IntoIter trait migrate partition kernel to use Iterator trait Jun 11, 2021
@alamb alamb added api-change Changes to the arrow API arrow Changes to the arrow crate labels Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-change Changes to the arrow API arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants