-
Notifications
You must be signed in to change notification settings - Fork 64
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
feat!(ffi): Make get_partition_column* work on a snapshot. #697
base: main
Are you sure you want to change the base?
feat!(ffi): Make get_partition_column* work on a snapshot. #697
Conversation
Also rename the old ones to get_scan_partition_column*
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #697 +/- ##
==========================================
+ Coverage 84.19% 84.42% +0.22%
==========================================
Files 77 77
Lines 17960 18004 +44
Branches 17960 18004 +44
==========================================
+ Hits 15122 15199 +77
+ Misses 2121 2087 -34
- Partials 717 718 +1 ☔ View full report in Codecov by Sentry. |
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.
It's anyway a breaking change; should we just delete this redundant API to have one right way of doing things?
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.
Given it's a breaking change, pls make the conventional commit a feat!
/// Get an iterator of the list of partition columns for this snapshot. | ||
/// | ||
/// # Safety | ||
/// Caller is responsible for passing a valid snapshot handle. |
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.
Should the caller also be freeing the strings? Mention it in the docs if it's worth mentioning.
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.
Should the caller also be freeing the strings?
No. String slices by definition are not owned.
In this specific case, the strings will be freed by the iterator itself when it gets dropped.
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.
Given it's a breaking change, pls make the conventional commit a feat!
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.
looks great :) seems similar to my schema changes in #709 - glad we are improving these!
pub enum TestAction { | ||
Add(String), | ||
Remove(String), | ||
Metadata, | ||
} | ||
|
||
/// Convert a vector of actions into a newline delimited json string | ||
// TODO: We need a better way to mock tables :) |
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.
agree - should we track an issue and try to size/prioritize it?
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.
LGTM, but make sure to update the PR description -- it still claims the old code was renamed instead of deleted.
/// Get an iterator of the list of partition columns for this snapshot. | ||
/// | ||
/// # Safety | ||
/// Caller is responsible for passing a valid snapshot handle. |
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.
Should the caller also be freeing the strings?
No. String slices by definition are not owned.
In this specific case, the strings will be freed by the iterator itself when it gets dropped.
What changes are proposed in this pull request?
Make
get_partition_column_count
andget_partition_columns
take a snapshot so engines can work this out at planning time without creating a scan.The previous methods to get this info out of a scan have been removed.
Yes, the old functions have had
_scan_
added to the name, so this is a breaking change. (but I don't know of anyone who was using the old ones other thanread_table.c
.How was this change tested?
New unit test