Skip to content

branch-4.1: [config](pick) Add max_bucket_num_per_partition config to limit bucket number #61576 #62286#62325

Merged
yiguolei merged 2 commits intoapache:branch-4.1from
gavinchou:gavin-pick-61576-branch-4.1
Apr 13, 2026
Merged

branch-4.1: [config](pick) Add max_bucket_num_per_partition config to limit bucket number #61576 #62286#62325
yiguolei merged 2 commits intoapache:branch-4.1from
gavinchou:gavin-pick-61576-branch-4.1

Conversation

@gavinchou
Copy link
Copy Markdown
Contributor

Summary

Pick PR #61576 and #62286 to branch-4.1, combining both changes into one commit.

Changes

Add a new FE config max_bucket_num_per_partition to limit the maximum number of buckets when creating a table or adding a partition. Default value is 768.

  1. Add max_bucket_num_per_partition config in Config.java, defaulting to 768
  2. Add bucket number validation in DistributionDescriptor.validate() for CREATE TABLE scenario
  3. Add bucket number validation in InternalCatalog.addPartition() for ALTER TABLE ADD PARTITION scenario
  4. Add unit tests for the new validation logic
  5. Add regression test configurations

Behavior

  • For user-specified buckets (CREATE TABLE / ALTER TABLE ADD PARTITION): if bucket number exceeds this limit, the operation will be rejected with a helpful error message
  • For auto-bucket feature (Dynamic Partition): bucket number is capped by autobucket_max_buckets automatically, no change
  • Set to 0 or negative value to disable this limit

Test

  • FE unit tests passed locally (DistributionDescriptorTest)
  • FE build passed locally

Related Issue

close #61576
close #62286

…t number

Add a new FE config `max_bucket_num_per_partition` to limit the maximum number
of buckets when creating a table or adding a partition. Default value is 768.

Changes:
1. Add `max_bucket_num_per_partition` config in Config.java, defaulting to 768
2. Add bucket number validation in `DistributionDescriptor.validate()` for CREATE TABLE scenario
3. Add bucket number validation in `InternalCatalog.addPartition()` for ALTER TABLE ADD PARTITION scenario
4. Add unit tests for the new validation logic
5. Add regression test configurations

Behavior:
- For user-specified buckets (CREATE TABLE / ALTER TABLE ADD PARTITION): if bucket
  number exceeds this limit, the operation will be rejected with a helpful error message
- For auto-bucket feature (Dynamic Partition): bucket number is capped by
  `autobucket_max_buckets` automatically, no change
- Set to 0 or negative value to disable this limit

Cherry-picked from PR apache#61576 and apache#62286
@gavinchou gavinchou requested a review from yiguolei as a code owner April 10, 2026 06:55
@Thearas
Copy link
Copy Markdown
Contributor

Thearas commented Apr 10, 2026

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@gavinchou
Copy link
Copy Markdown
Contributor Author

run buildall

@gavinchou gavinchou changed the title [config](pick) Add max_bucket_num_per_partition config to limit bucket number [config](pick) Add max_bucket_num_per_partition config to limit bucket number #61576 #62286 Apr 10, 2026
@gavinchou gavinchou changed the title [config](pick) Add max_bucket_num_per_partition config to limit bucket number #61576 #62286 branch-4.1: [config](pick) Add max_bucket_num_per_partition config to limit bucket number #61576 #62286 Apr 10, 2026
@gavinchou
Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 27.27% (3/11) 🎉
Increment coverage report
Complete coverage report

@yiguolei yiguolei merged commit f291feb into apache:branch-4.1 Apr 13, 2026
25 of 28 checks passed
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.

4 participants