-
Couldn't load subscription status.
- Fork 118
feat(FFI): snapshot log tail FFI #1379
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1379 +/- ##
==========================================
+ Coverage 84.73% 84.88% +0.14%
==========================================
Files 113 114 +1
Lines 28396 29040 +644
Branches 28396 29040 +644
==========================================
+ Hits 24062 24651 +589
- Misses 3198 3215 +17
- Partials 1136 1174 +38 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
b275a62 to
f9e24c6
Compare
| // Convert LogPathArray to Vec<LogPath> | ||
| let log_tail = match unsafe { log_tail.log_paths() } { | ||
| Ok(paths) => paths, | ||
| Err(e) => return DeltaResult::Err(e).into_extern_result(&engine_ref), |
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.
| Err(e) => return DeltaResult::Err(e).into_extern_result(&engine_ref), | |
| err => return err.into_extern_result(&engine_ref), |
| let log_path = | ||
| log_path::FfiLogPath::new(kernel_string_slice!(commit1_path), 123456789, 100); | ||
| let log_tail = vec![log_path]; | ||
| let log_tail = log_path::LogPathArray { | ||
| ptr: log_tail.as_ptr(), | ||
| len: log_tail.len(), | ||
| }; |
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.
Might be worth just making a LogPathArray::fromVec.
Also, while it's handled right here, I think we need to be very careful with Vec since drop could still be called and we'd have a use-after-free.
What changes are proposed in this pull request?
Adds two new APIs for our FFI to support catalog-managed tables:
snapshot_with_log_tailto get the latest snapshot of a catalog-managed tablesnapshot_at_version_with_log_tailto get the snapshot of a catalog-managed table at a specific versionAnd in order to implement the above, a new
LogPathArraytype is introduced to communicateVec<LogPath>across FFI (basically just uses ptr + len for the array type and theFfiLogPathdoes KernelStringSlice + size + mod time)The above APIs are behind a new
catalog-managed(FFI) feature flag similar to kernel's owncatalog-managedflag.How was this change tested?
new UT