Skip to content

HIVE-29608: Support database-level Exclusion for Automatic Column Statistics Deletion - #6767

Open
DanielZhu58 wants to merge 1 commit into
apache:masterfrom
DanielZhu58:HIVE-29608_master
Open

HIVE-29608: Support database-level Exclusion for Automatic Column Statistics Deletion#6767
DanielZhu58 wants to merge 1 commit into
apache:masterfrom
DanielZhu58:HIVE-29608_master

Conversation

@DanielZhu58

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Extends the automatic column statistics deletion task (HIVE-28755) to support a database-level exclude property (statistics.auto.deletion.exclude), alongside the existing table-level property. A table/partition is now skipped if either its table or its database has the property set to "true".

Why are the changes needed?

Currently, excluding tables from auto-deletion requires setting the property on every table individually. This lets users exclude an entire database in one step, covering current and future tables.

Does this PR introduce any user-facing change?

Yes. Users can set statistics.auto.deletion.exclude=true on a database to exclude all its tables from automatic column statistics deletion. Existing table-level behavior is unchanged; the two are combined with OR semantics.

How was this patch tested?

Added unit tests in TestStatisticsManagement.java covering: database-level exclusion of table and partition stats, database exclude property set to "false" not preventing deletion, and database-level exclusion taking precedence when the table property is explicitly "false".

@sonarqubecloud

sonarqubecloud Bot commented Sep 9, 2026

Copy link
Copy Markdown

*/
public static final String STATISTICS_AUTO_DELETION_EXCLUDE_TBLPROPERTY =
"statistics.auto.deletion.exclude";
public static final String STATISTICS_AUTO_DELETION_EXCLUDE_DBPROPERTY =

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can it be merged with STATISTICS_AUTO_DELETION_EXCLUDE_TBLPROPERTY?

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.

3 participants