-
Notifications
You must be signed in to change notification settings - Fork 421
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: failing test est_restore_by_datetime #2000
Changes from 1 commit
a8676a5
e5ab0a4
18bc6dc
cfe3db9
94b19bf
87e5f29
a8d46ee
ff6ac93
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Signed-off-by: Nikolay Ulmasov <[email protected]>
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -638,9 +638,14 @@ impl DeltaTable { | |
&mut self, | ||
version: i64, | ||
) -> Result<i64, DeltaTableError> { | ||
// Use a cached timestamp info if available | ||
match self.version_timestamp.get(&version) { | ||
Some(ts) => Ok(*ts), | ||
None => { | ||
// Load the version specified | ||
if self.version() != version { | ||
self.load_version(version).await?; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @r3stl355 I am not as familiar with the callers of I'm honestly not sure if |
||
} | ||
let timestamp: Option<i64> = if !self.state.commit_infos().is_empty() { | ||
self.state.commit_infos().last().unwrap().timestamp | ||
} else { | ||
|
@@ -891,7 +896,6 @@ impl DeltaTable { | |
while min_version <= max_version { | ||
let pivot = (max_version + min_version) / 2; | ||
version = pivot; | ||
self.load_version(version).await?; | ||
let pts = self.get_version_timestamp(pivot).await?; | ||
match pts.cmp(&target_ts) { | ||
Ordering::Equal => { | ||
|
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.
Instead of loading the version each time, we could also just do this
self.state.commit_infos().get(version).unwrap().timestamp
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.
@ion-elgreco Setting aside the concerns I have shared with reliance on
commitInfo
, I believe that invocation is not guaranteed to return the right versioned information if the version has not been loaded already.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.
Just think aloud here but in general you shouldn't be able to restore to a version of a table that's above the current loaded table version