feat(catalog): adding support for purge_table#2232
Draft
CTTY wants to merge 1 commit intoapache:mainfrom
Draft
Conversation
CTTY
commented
Mar 12, 2026
| /// When set to `false`, data files will not be deleted when a table is dropped. | ||
| /// Defaults to `true`. | ||
| pub const GC_ENABLED: &str = "gc.enabled"; | ||
| const GC_ENABLED_DEFAULT: bool = true; |
Collaborator
Author
There was a problem hiding this comment.
Should be moved to TableProperty
| } | ||
|
|
||
| /// Deletes a collection of files, suppressing individual failures. | ||
| async fn delete_files<'a>(io: &FileIO, paths: impl Iterator<Item = &'a str>) { |
Collaborator
Author
There was a problem hiding this comment.
Should use delete_stream api we are about to add
| /// the table does not exist. | ||
| /// - Any network or communication error occurs with the database backend. | ||
| async fn drop_table(&self, table: &TableIdent) -> Result<()> { | ||
| async fn drop_table_with_purge(&self, table: &TableIdent, _purge: bool) -> Result<()> { |
Collaborator
Author
There was a problem hiding this comment.
glue should use purge
| /// the table does not exist. | ||
| /// - Any network or communication error occurs with the database backend. | ||
| async fn drop_table(&self, table: &TableIdent) -> Result<()> { | ||
| async fn drop_table_with_purge(&self, table: &TableIdent, _purge: bool) -> Result<()> { |
Collaborator
Author
There was a problem hiding this comment.
hms should use purge, looking at java's impl: https://github.com/apache/iceberg/blob/8c2ca1d084fca37671ba8b38d59ea3f5a187b147/hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java#L244-L251
Looks like we intend to skip hive's purge but use fileIO to purge table
| } | ||
|
|
||
| async fn drop_table(&self, identifier: &TableIdent) -> Result<()> { | ||
| async fn drop_table_with_purge(&self, identifier: &TableIdent, _purge: bool) -> Result<()> { |
Collaborator
Author
There was a problem hiding this comment.
I'm actually not sure if sqlCatalog should support this
|
|
||
| /// Drop a table from the catalog. | ||
| async fn drop_table(&self, table_ident: &TableIdent) -> Result<()> { | ||
| async fn drop_table_with_purge(&self, table_ident: &TableIdent, _purge: bool) -> Result<()> { |
Collaborator
Author
There was a problem hiding this comment.
Memory catalog should use purge
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
What changes are included in this PR?
Are these changes tested?