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

[query] Offset function #1561

Merged
merged 7 commits into from
Apr 20, 2019
Merged

[query] Offset function #1561

merged 7 commits into from
Apr 20, 2019

Conversation

arnikola
Copy link
Collaborator

@arnikola arnikola commented Apr 16, 2019

Updated offset to create a downstream processing function rather than fixing in iterators

@andrewmains12
Copy link
Contributor

General question on this: for most operations, we apply them eagerly--that is, we iterate through the block and create a new block. What makes it such that offset needs to be done in a custom block type/iterator instead?


defer nextBlock.Close()
return controller.Process(queryCtx, nextBlock)
// ProcessWrapperBlock works similarly to ProcessSimpleBlock, but does not close
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably debatable, but maybe best to just not use the helper in this case? There are already functions which don't (for basically the same reason--they need more control over the block lifecycle). Especially because we comment pretty explicitly down below; might be more clear to just manage the lifecycle directly there.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, did it this way mostly because I didn't realize that we already had a couple of blocks that don't use it, so happy to revert these changes.

@arnikola
Copy link
Collaborator Author

General question on this: for most operations, we apply them eagerly--that is, we iterate through the block and create a new block. What makes it such that offset needs to be done in a custom block type/iterator instead?

That's true for most functions, since they generally collapse the input space during execution (temporal functions excluded unfortunately), but we have some functions which we can apply lazily as a simple transform, which can then defer decoding until an aggregation function is ready to collapse the results.

We do have some code in place for lazily applying functions, but it's pretty awkward to use and probably needs an update to look more like this model (i.e. pass down a function into OffsetBlock, maybe rename it to something like FunctionBlock, and let it do transforms there; as such I guess this PR both adds the offset and a skeleton for building future lazy functions

@arnikola arnikola mentioned this pull request Apr 17, 2019
13 tasks
@robskillington
Copy link
Collaborator

Nice, this looks a ton better than the other alternative!

@codecov
Copy link

codecov bot commented Apr 17, 2019

Codecov Report

Merging #1561 into master will increase coverage by <.1%.
The diff coverage is 95.7%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #1561     +/-   ##
========================================
+ Coverage    71.8%   71.8%   +<.1%     
========================================
  Files         946     949      +3     
  Lines       78019   78206    +187     
========================================
+ Hits        56027   56165    +138     
- Misses      18348   18394     +46     
- Partials     3644    3647      +3
Flag Coverage Δ
#aggregator 82.3% <ø> (ø) ⬆️
#cluster 85.7% <ø> (ø) ⬆️
#collector 63.7% <ø> (ø) ⬆️
#dbnode 80% <ø> (-0.1%) ⬇️
#m3em 73.2% <ø> (-0.1%) ⬇️
#m3ninx 74% <ø> (ø) ⬆️
#m3nsch 51.1% <ø> (ø) ⬆️
#metrics 17.5% <ø> (-0.1%) ⬇️
#msg 74.9% <ø> (+0.1%) ⬆️
#query 66.8% <95.7%> (+0.3%) ⬆️
#x 85.7% <ø> (-1%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7dad7ee...887dac1. Read the comment docs.

@arnikola arnikola merged commit f2168e1 into master Apr 20, 2019
@arnikola arnikola deleted the arnikola/offset branch April 20, 2019 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants