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

Scan::execute takes an Arc<dyn EngineData> now #553

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

scovich
Copy link
Collaborator

@scovich scovich commented Nov 28, 2024

What changes are proposed in this pull request?

A previous change made Scan::execute return a lazy iterator instead of a collection, but in doing so it captured a &dyn Engine which limits the lifetime of the iterator. This is silly, given that the caller has access to an Arc<dyn Engine> precisely to avoid lifetime problems.

Update the method to take an Arc and fix the compiler carnage that results.

Fixes #551

This PR affects the following public APIs

Scan::execute is public, as are some of the impacted methods that rely on it.

How was this change tested?

Compilation suffices (yay for rust borrow checker!)

Copy link

codecov bot commented Nov 28, 2024

Codecov Report

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

Project coverage is 80.61%. Comparing base (953ceed) to head (e682bce).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
kernel/src/scan/mod.rs 89.47% 0 Missing and 2 partials ⚠️
acceptance/src/data.rs 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #553   +/-   ##
=======================================
  Coverage   80.61%   80.61%           
=======================================
  Files          67       67           
  Lines       14278    14278           
  Branches    14278    14278           
=======================================
  Hits        11510    11510           
  Misses       2188     2188           
  Partials      580      580           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +494 to 495
read_with_scan_data(table.location(), engine.as_ref(), &scan, &expected)?;
read_with_execute(engine, &scan, &expected)?;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note: Order swapped so we don't have to clone the engine that read_with_execute consumes

@scovich
Copy link
Collaborator Author

scovich commented Nov 28, 2024

Attn @zachschuermann: something went wrong with the semver check, it didn't flag a change to a pub fn signature in a pub struct in a pub mod as a breaking change??

Copy link
Collaborator

@OussamaSaoudi-db OussamaSaoudi-db left a comment

Choose a reason for hiding this comment

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

nice!

@scovich scovich requested a review from hntd187 December 2, 2024 22:47
Copy link
Collaborator

@hntd187 hntd187 left a comment

Choose a reason for hiding this comment

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

This seems very reasonable to me.

@scovich scovich added the breaking-change Change that will require a version bump label Dec 2, 2024
@scovich scovich merged commit 420af1f into delta-io:main Dec 2, 2024
25 checks passed
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. thanks, this is better!

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.

Different lifetimes for Engine argument and returned Iterator of Scan::execute
4 participants