-
Notifications
You must be signed in to change notification settings - Fork 4.7k
HIVE-28644: Iceberg: Add support for SMART OPTIMIZE feature #5621
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
|
@@ -63,6 +59,15 @@ public Boolean compact(Table table, CompactionInfo ci) throws Exception { | |||
return false; | |||
} | |||
|
|||
if (ci.type == CompactionType.SMART_OPTIMIZE) { | |||
ci.type = compactionEvaluator.determineCompactionType(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we create a local var CompactionType type = ompactionEvaluator.determineCompactionType()
and assign to ci.type
after the null check?
What changes were proposed in this pull request?
Added support for smart optimization as part of 'OPTIMIZE TABLE ... REWRITE DATA' command so that compaction type will be determined at runtime by analyzing the state of the table/partition to be compacted.
Why are the changes needed?
To improve compaction by determining the best compaction type (MAJOR, MINOR) at runtime for 'OPTIMIZE TABLE ... REWRITE DATA' command.
Does this PR introduce any user-facing change?
No
Is the change a dependency upgrade?
No
How was this patch tested?
Updated existing unit tests and q-tests.