-
Notifications
You must be signed in to change notification settings - Fork 294
feat: drop column for schema evolution #1582
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
832e327
to
cbdb100
Compare
cbdb100
to
477519e
Compare
/// # Returns | ||
/// | ||
/// Returns the `UpdateSchema` with the delete operation staged. | ||
pub fn delete_column(&mut self, column_name: Vec<String>) -> Result<&mut Self> { |
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.
One thing I'm hesitant about is, is it better to provide a transaction action SetSchemaAction
.
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.
Thanks @dentiny for adding this pr! The implementation is incorrect, please take other actions as reference. In general, all actions methods are used as builder method to store changes, and actual validation and change happens in commit method.
/// # Returns | ||
/// | ||
/// Returns the `UpdateSchema` with the delete operation staged. | ||
pub fn delete_column(&mut self, column_name: Vec<String>) -> Result<&mut Self> { |
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.
pub fn delete_column(&mut self, column_name: Vec<String>) -> Result<&mut Self> { | |
pub fn drop_column(&mut self, column_name: Vec<String>) -> Result<&mut Self> { |
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.
I think the column_name
to be String
would be enough.
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.
The implementation is incorrect. All changes should happen in the commit
method.
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.
Gotcha, updated. Thank you!
72bb406
to
57531f6
Compare
What changes are included in this PR?
I want to take over @jonathanc-n 's previous work on schema evolution: already contacted him offline.
Previous PR for reference: #1172
In this PR, I implemented the column deletion logic, which is the simplest part; and integrate with the new transaction API.
Are these changes tested?
Yes, unit tests added.