Skip to content

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

dentiny
Copy link
Contributor

@dentiny dentiny commented Aug 5, 2025

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.

@dentiny dentiny force-pushed the hjiang/delete-column-implementation branch from 832e327 to cbdb100 Compare August 5, 2025 22:19
@dentiny dentiny force-pushed the hjiang/delete-column-implementation branch from cbdb100 to 477519e Compare August 5, 2025 22:35
/// # Returns
///
/// Returns the `UpdateSchema` with the delete operation staged.
pub fn delete_column(&mut self, column_name: Vec<String>) -> Result<&mut Self> {
Copy link
Contributor Author

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.

Copy link
Contributor

@liurenjie1024 liurenjie1024 left a 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> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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> {

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Gotcha, updated. Thank you!

@dentiny dentiny changed the title feat: delete column for schema evolution feat: drop column for schema evolution Aug 10, 2025
@dentiny dentiny force-pushed the hjiang/delete-column-implementation branch from 72bb406 to 57531f6 Compare August 11, 2025 07:40
@dentiny dentiny requested a review from liurenjie1024 August 11, 2025 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants