Skip to content

feat: drop column for schema evolution#1582

Closed
dentiny wants to merge 9 commits intoapache:mainfrom
dentiny:hjiang/delete-column-implementation
Closed

feat: drop column for schema evolution#1582
dentiny wants to merge 9 commits intoapache:mainfrom
dentiny:hjiang/delete-column-implementation

Conversation

@dentiny
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Comment on lines +35 to +36
/// Current schema before update.
schema: SchemaRef,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is incorrect, we should not store this, it should be fetched from table's current schema when applying.

@github-actions
Copy link
Copy Markdown
Contributor

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions.

@github-actions github-actions bot added the stale label Feb 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 6, 2026

This pull request has been closed due to lack of activity. This is not a judgement on the merit of the PR in any way. It is just a way of keeping the PR queue manageable. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.

@github-actions github-actions bot closed this Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants