Skip to content

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

difin
Copy link
Contributor

@difin difin commented Jan 25, 2025

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.

@difin difin marked this pull request as draft January 25, 2025 00:32
@@ -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();
Copy link
Member

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?

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.

4 participants