Skip to content

feat(catalog): adding support for purge_table#2232

Draft
CTTY wants to merge 1 commit intoapache:mainfrom
CTTY:ctty/purge-table
Draft

feat(catalog): adding support for purge_table#2232
CTTY wants to merge 1 commit intoapache:mainfrom
CTTY:ctty/purge-table

Conversation

@CTTY
Copy link
Collaborator

@CTTY CTTY commented Mar 12, 2026

Which issue does this PR close?

  • Closes #.

What changes are included in this PR?

Are these changes tested?

/// 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;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

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>) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

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<()> {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

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<()> {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

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<()> {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

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<()> {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Memory catalog should use purge

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.

1 participant