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

fix: reading cdf from a checkpointed table #3110

Merged
merged 2 commits into from
Jan 10, 2025
Merged

fix: reading cdf from a checkpointed table #3110

merged 2 commits into from
Jan 10, 2025

Conversation

hntd187
Copy link
Collaborator

@hntd187 hntd187 commented Jan 9, 2025

Description

Fixes a bug where you cannot read CDF from a table that has been checkpointed or vacuumed

Related Issue(s)

@github-actions github-actions bot added binding/python Issues for the Python package binding/rust Issues for the Rust crate labels Jan 9, 2025
Copy link

codecov bot commented Jan 9, 2025

Codecov Report

Attention: Patch coverage is 81.81818% with 14 lines in your changes missing coverage. Please review.

Project coverage is 72.40%. Comparing base (0b90a11) to head (b62cfc2).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
crates/core/src/operations/load_cdf.rs 87.50% 2 Missing and 7 partials ⚠️
python/src/lib.rs 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3110      +/-   ##
==========================================
+ Coverage   72.37%   72.40%   +0.03%     
==========================================
  Files         128      128              
  Lines       41301    41366      +65     
  Branches    41301    41366      +65     
==========================================
+ Hits        29892    29953      +61     
- Misses       9494     9500       +6     
+ Partials     1915     1913       -2     

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

@@ -107,6 +107,25 @@ impl CdfLoadBuilder {
self
}

async fn calculate_earliest_version(&self) -> DeltaResult<i64> {
let ts = self.starting_timestamp.unwrap_or(DateTime::UNIX_EPOCH);
for v in 0..self.snapshot.version() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This could be potentially expensive, can't we do a binary search between 0 and the last checkpoint version?

The log store has the get_earliest_version function, which is also not efficient. I thought redirection would be configurable there but it's not unfortunately. But we could replace that with a binary search there and it would help for other use cases as well

Copy link
Member

@rtyler rtyler left a comment

Choose a reason for hiding this comment

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

I am comfortable with an inefficient bug fix now and optimizations later. I'm going to pull this in ahead of the LakeFS work @ion-elgreco so I can release this as a patch before we start the 0.24 work

@rtyler rtyler added this pull request to the merge queue Jan 10, 2025
@rtyler rtyler added this to the v0.23 milestone Jan 10, 2025
@ion-elgreco
Copy link
Collaborator

I am comfortable with an inefficient bug fix now and optimizations later. I'm going to pull this in ahead of the LakeFS work @ion-elgreco so I can release this as a patch before we start the 0.24 work

Alrighty, I can do a follow up on this then after lakefs work is in :)

Merged via the queue into main with commit 5727ba7 Jan 10, 2025
24 checks passed
@rtyler rtyler deleted the checkpointed-cdf branch January 10, 2025 13:59
@hntd187
Copy link
Collaborator Author

hntd187 commented Jan 10, 2025

Yeah, I can touch up the perf on this a bit after all the other stuff is settled down. But I'd say generally users should provide versions if they know them, it will make everything work better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
binding/python Issues for the Python package binding/rust Issues for the Rust crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

load_cdf errors out on starting-timestamp only request
3 participants