Skip to content
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

API: Add function for removing Specs from Metadata.json which are no … #3462

Closed
wants to merge 1 commit into from

Conversation

RussellSpitzer
Copy link
Member

…longer in use

Previously there was no way to remove partition specs from a table once they were
added. To fix this we add an api which searches through all reachable mainfest
files and records their specsIds. Any specIds which do not find are marked for
removal which is done through a serializable commit.

MetadataTableUtils.createMetadataTableInstance(table, MetadataTableType.ALL_ENTRIES)
.newScan()
.planFiles(),
fileScanTask -> ((ManifestEntriesTable.ManifestReadTask) (fileScanTask)).partitionSpecId()
Copy link
Member Author

Choose a reason for hiding this comment

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

So the reason I use this api, and not actually accessing the underlying rows of ALL_MANIFESTS table is that for tables which have corrupt specs (from previous bugs) will be unable to actually generate the common "partition" schema which is required to actually manifest rows. This table instead just gets us ManifestFiles which we can check the specID of directly.

@RussellSpitzer
Copy link
Member Author

@rdblue Please let me know what you think about this for the removing unused specs / removing broken and unused specs from table utility

…longer in use

Previously there was no way to remove partition specs from a table once they were
added. To fix this we add an api which searches through all reachable mainfest
files and records their specsIds. Any specIds which do not find are marked for
removal which is done through a serializable commit.
@RussellSpitzer
Copy link
Member Author

@aokolnychyi do you think this is still worth doing? I can update the PR if so

Copy link

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 Jul 29, 2024
Copy link

github-actions bot commented Aug 6, 2024

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 Aug 6, 2024
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