-
Notifications
You must be signed in to change notification settings - Fork 32
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
Add Take for REEArray #162
Conversation
}) | ||
.collect::<VortexResult<Vec<_>>>()? | ||
}); | ||
take(self.values(), &PrimitiveArray::from(physical_indices)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same pattern that happens in Dict array, repeated value take on some dictionary.
impl TakeFn for REEArray { | ||
fn take(&self, indices: &dyn Array) -> VortexResult<ArrayRef> { | ||
let primitive_indices = flatten_primitive(indices)?; | ||
let physical_indices = match_each_integer_ptype!(primitive_indices.ptype(), |$P| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should just be a search_sorted? Possibly this? #164
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That said, an iterator would allow us to apply the offset inline without allocating a new buffer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just search sorted. That’s what find_physical_index does
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but a lot of function calls, vs search_sorted_many
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
No description provided.