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

Remove lifetime requirement on Scan::execute #588

Merged
merged 3 commits into from
Dec 11, 2024

Conversation

OussamaSaoudi-db
Copy link
Collaborator

What changes are proposed in this pull request?

Currently, Scan::execute takes the lifetime of the Scan 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 of Scan. This simplifies the usage of kernel

This PR also changes all read_schema names to physical_schema to make it clear and consistent what the schema represents. note that Snapshot already calls this the physical_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 :)

@github-actions github-actions bot added the breaking-change Change that will require a version bump label Dec 10, 2024
Copy link

codecov bot commented Dec 10, 2024

Codecov Report

Attention: Patch coverage is 85.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 83.47%. Comparing base (7bcbb57) to head (bb3704b).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
kernel/src/scan/mod.rs 87.50% 0 Missing and 2 partials ⚠️
ffi/src/scan.rs 0.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@OussamaSaoudi-db OussamaSaoudi-db requested review from nicklan, scovich and zachschuermann and removed request for nicklan and scovich December 10, 2024 23:50
Copy link
Collaborator

@scovich scovich left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@nicklan nicklan left a 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 :)

Copy link
Collaborator

@zachschuermann zachschuermann left a 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();
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

@OussamaSaoudi-db OussamaSaoudi-db merged commit 04ccccb into delta-io:main Dec 11, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Change that will require a version bump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants