-
Notifications
You must be signed in to change notification settings - Fork 388
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
New and improved iteration APIs for Chunk
s
#6989
Conversation
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.
so many iterators * _ *
looks good tho
#[inline] | ||
pub fn iter_indices(&self, timeline: &Timeline) -> impl Iterator<Item = (TimeInt, RowId)> + '_ { | ||
if self.is_static() { | ||
Either::Right(Either::Left(izip!( |
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.
nit: the way you decide when to pick left/right seems a bit arbitrary and is hard to read
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.
It is not arbitrary!
They should all follow this model:
- The first layer is always the emptiness layer:
Left
is empty,Right
is non-empty. - The second layer is the temporarily layer:
Left
is static,Right
is temporal. - Any layers beyond that follow the same pattern:
Left
doesn't have something, whileRight
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.
Added a comment in the code reflecting that.
let indices = izip!(std::iter::repeat(TimeInt::STATIC), self.row_ids()); | ||
|
||
if let Some(validity) = list_array.validity() { | ||
Either::Right(Either::Left(Either::Left( |
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.
... not sure why I whined about double nested either earlier Oo. Maybe you want to introduce new IterVariants3
and IterVariants4
iterators which internally match things?
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.
Tbh I'd rather keep the nicely composable Either
than introduce more ad-hoc things.
The caller never has to deal with them anyhow 🤷
Just bunch of brand new and/or improved iteration APIs for
Chunk
s.This will be used all over the place with the new query APIs, which will appear in a future PR.
Checklist
main
build: rerun.io/viewernightly
build: rerun.io/viewerCHANGELOG.md
and the migration guideTo run all checks from
main
, comment on the PR with@rerun-bot full-check
.