HIVE-29608: Support database-level Exclusion for Automatic Column Statistics Deletion - #6767
Open
DanielZhu58 wants to merge 1 commit into
Open
HIVE-29608: Support database-level Exclusion for Automatic Column Statistics Deletion#6767DanielZhu58 wants to merge 1 commit into
DanielZhu58 wants to merge 1 commit into
Conversation
DanielZhu58
force-pushed
the
HIVE-29608_master
branch
from
September 9, 2026 11:22
b24543f to
34bd0e9
Compare
|
dengzhhu653
reviewed
Sep 10, 2026
| */ | ||
| public static final String STATISTICS_AUTO_DELETION_EXCLUDE_TBLPROPERTY = | ||
| "statistics.auto.deletion.exclude"; | ||
| public static final String STATISTICS_AUTO_DELETION_EXCLUDE_DBPROPERTY = |
Member
There was a problem hiding this comment.
can it be merged with STATISTICS_AUTO_DELETION_EXCLUDE_TBLPROPERTY?
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.



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".