Skip to content

[Fix] Support KEY_DYNAMIC bucket mode in CompactorSinkBuilder - #9338

Open
zhang-arvin wants to merge 1 commit into
apache:masterfrom
zhang-arvin:fix/compactor-key-dynamic-bucket-9256
Open

[Fix] Support KEY_DYNAMIC bucket mode in CompactorSinkBuilder#9338
zhang-arvin wants to merge 1 commit into
apache:masterfrom
zhang-arvin:fix/compactor-key-dynamic-bucket-9256

Conversation

@zhang-arvin

Copy link
Copy Markdown

Which issues does this PR fix?

Closes #9256.

What changes are included in this PR?

When using KEY_DYNAMIC bucket mode (bucket = -1 with crossPartitionUpdate), the CALL sys.compact procedure would throw:

UnsupportedOperationException: Unsupported bucket mode: KEY_DYNAMIC

The CompactorSinkBuilder only handled HASH_FIXED and HASH_DYNAMIC bucket modes, but KEY_DYNAMIC is also a bucket-aware mode that should use the same buildForBucketAware() path.

Root Cause

In CompactorSinkBuilder.build(), the switch statement on BucketMode only had cases for HASH_FIXED and HASH_DYNAMIC. The KEY_DYNAMIC case was missing, causing it to fall through to the default branch which throws an UnsupportedOperationException.

Fix

Add KEY_DYNAMIC to the case statement alongside HASH_DYNAMIC so that it also routes to buildForBucketAware().

How was this patch tested?

The change is a one-line addition of a case statement. The FlinkSinkBuilder already handles KEY_DYNAMIC by routing to buildDynamicBucketSink(input, true), confirming that KEY_DYNAMIC is a valid bucket-aware mode that should be supported in the compaction path.

This closes apache#9256.

When using KEY_DYNAMIC bucket mode (bucket = -1 with crossPartitionUpdate),
the CALL sys.compact procedure would throw:
  UnsupportedOperationException: Unsupported bucket mode: KEY_DYNAMIC

The CompactorSinkBuilder only handled HASH_FIXED and HASH_DYNAMIC,
but KEY_DYNAMIC is also a bucket-aware mode that should use the same
buildForBucketAware() path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Unsupported to CALL a dedicated minor/full compaction

1 participant