-
Notifications
You must be signed in to change notification settings - Fork 66
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
Remove lifetime requirement on Scan::execute
#588
Remove lifetime requirement on Scan::execute
#588
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #588 +/- ##
==========================================
+ Coverage 83.44% 83.47% +0.02%
==========================================
Files 74 74
Lines 16861 16867 +6
Branches 16861 16867 +6
==========================================
+ Hits 14069 14079 +10
+ Misses 2132 2130 -2
+ Partials 660 658 -2 ☔ View full report in Codecov by Sentry. |
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.
LGTM
8748e8a
to
bb3704b
Compare
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.
lgtm. i was actually looking at something similar as i was working on my expression pr, so this is nice :)
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.
quick question but LGTM!
)?; | ||
|
||
// Arc clones | ||
let engine = engine.clone(); | ||
let global_state = global_state.clone(); | ||
let all_fields = all_fields.clone(); |
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.
we clone here and above: can we get by with just one?
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 don't think so 😔 Both closures are move
, so each closure wants ownership of its own all_fields
. We'll eventually be able to avoid the clone by moving the construction of P2L expression evaluator out of the inner loop.
What changes are proposed in this pull request?
Currently,
Scan::execute
takes the lifetime of theScan
into the Iterator, forcing it to live as long as the scan. This Pr removes that requirement so that the user can lazily consume the iterator without managing the lifetime ofScan
. This simplifies the usage of kernelThis PR also changes all
read_schema
names tophysical_schema
to make it clear and consistent what the schema represents. note thatSnapshot
already calls this thephysical_schema
This PR affects the following public APIs
Scan::execute
no longer depends on the lifetime of&self
How was this change tested?
Everything compiles :)