Skip to content

Conversation

@hackintoshrao
Copy link

Summary

Modify RESTSessionCatalog.dropTable() to explicitly send purgeRequested=false instead of omitting the parameter.

Problem

Currently, dropTable(context, identifier) sends a DELETE request without the purgeRequested parameter, relying on the server to default to false.

However, some catalogs default purgeRequested=true to work around Spark's bug where it doesn't forward purgeRequested=true even with DROP TABLE ... PURGE (#11023, #11317).

With such catalogs, calling catalog.dropTable(identifier, false) unexpectedly purges table data because the parameter is omitted and the server defaults to true.

Solution

Explicitly send purgeRequested=false:

client.delete(
    paths.table(identifier),
    ImmutableMap.of("purgeRequested", "false"),
    ...);

This ensures the client's intent is honored regardless of server defaults.

Related Issues

…t purge

The REST catalog client previously omitted the purgeRequested parameter
when calling dropTable with purge=false. This relied on the server
defaulting to purge=false.

However, some catalogs (e.g., MinIO AIStor) default purgeRequested to
true to work around Spark's bug where it doesn't forward purgeRequested=true
even when DROP TABLE ... PURGE is used.

With those catalogs, calling dropTable(identifier, false) would unexpectedly
purge the table data because the parameter was omitted and the server
defaulted to true.

This change explicitly sends purgeRequested=false to ensure the client's
intent is honored regardless of the server's default behavior.

Relates to: apache#11023
@github-actions github-actions bot added the core label Jan 28, 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.

1 participant