Skip to content

Add ability to undelete a column#16089

Open
fbertsch wants to merge 9 commits into
apache:mainfrom
fbertsch:add_undelete
Open

Add ability to undelete a column#16089
fbertsch wants to merge 9 commits into
apache:mainfrom
fbertsch:add_undelete

Conversation

@fbertsch
Copy link
Copy Markdown

  • Extract the latest instance of that column name from historical schemas
  • Required columns will fail undelete if data has been written
  • Use set_nullable to allow required columns missing data to be undeleted and made nullable
  • The parent field must already be present in the schema
  • Add spark procedure calls to run undelete

Frank Bertsch added 8 commits January 19, 2026 19:24
- Extract the latest instance of that column name from historical
  schemas
- Required columns will be come non-required
- The parent field must already be present in the schema
- Add spark procedure call to run undelete
This is common logic that is a little confusing at first glance.
Also adds a hard failure in the case that the parent field
is, for some reason, not available in the schema (this should
be impossible, and if it happens, will return a null pointer)
Non-null defaults are only available in v3, so set the version
in the test.
- Add function to check whether data had been written for a col
  after the col was deleted
- Fail to undelete a required col if data was written after it
  had been deleted
- Add set_nullable parameter to force those cols as nullable,
  bypassing the failure (and allowing you to undelete a reqd
  col)
@fbertsch
Copy link
Copy Markdown
Author

@steveloughran @gtrettenero @yingjianwu98 the old PR was auto-closed so I had to open a new one with the changes. There are two changes:

  1. Required columns stay required, and the undelete fails if data was written to that column since it was removed
  2. A new parameter that allows a user to set a required column to nullable (i.e. same behavior as previously)

This more closely matches the Iceberg spec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant