Skip to content

[Feature] Support create history dynamic partition#5703

Merged
morningman merged 9 commits intoapache:masterfrom
morningman:fill_histo_partition
May 8, 2021
Merged

[Feature] Support create history dynamic partition#5703
morningman merged 9 commits intoapache:masterfrom
morningman:fill_histo_partition

Conversation

@morningman
Copy link
Contributor

@morningman morningman commented Apr 25, 2021

Proposed changes

  1. Add a new dynamic partition property create_history_partition.

    If set to true, Doris will create all partitions from start to end.

  2. Add a new FE config max_dynamic_partition_num

    To limit the number of partitions created when creating one table.

Types of changes

What types of changes does your code introduce to Doris?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)
  • Code refactor (Modify the code structure, format the code, etc...)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have created an issue on (Fix #ISSUE) and described the bug/feature there in detail
  • Compiling and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • If these changes need document changes, I have updated the document
  • Any dependent changes have been merged

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

@morningman morningman added area/catalog Issues or PRs related to catalog management api-review Categorizes an issue or PR as actively needing an API review. labels Apr 25, 2021
@morningman morningman self-assigned this Apr 25, 2021
EmmyMiao87
EmmyMiao87 previously approved these changes May 7, 2021

* `dynamic_partition.create_history_partition`

默认为 false。当置为 true 时,Doris 会自动创建由 start 到 end 的所有分区。同时,FE 的参数 `max_dynamic_partition_num` 会限制总分区数量,以避免一次性创建过多分区。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果 max_dynamic_partition_num 大于 end - start 则无法创建动态分区,并且报错xxx。描述一下

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

* The number is determined by "start" and "end" in the dynamic partition parameters.
*/
@ConfField(mutable = true, masterOnly = true)
public static int max_dynamic_partition_num = 500;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

新配置加个文档说明吧

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK


默认为 false。当置为 true 时,Doris 会自动创建由 start 到 end 的所有分区。同时,FE 的参数 `max_dynamic_partition_num` 会限制总分区数量,以避免一次性创建过多分区。当 end - start 的值大于 `max_dynamic_partition_num` 值时,操作将被禁止。

当不指定 `start` 属性时,该参数不生效。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

缩进问题

@morningman morningman force-pushed the fill_histo_partition branch from 6a34de3 to 6823645 Compare May 8, 2021 03:40
Copy link
Contributor

@EmmyMiao87 EmmyMiao87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@EmmyMiao87 EmmyMiao87 added the approved Indicates a PR has been approved by one committer. label May 8, 2021
@morningman morningman merged commit 11cce06 into apache:master May 8, 2021
morningman added a commit to morningman/doris that referenced this pull request May 8, 2021
This bug is introduced from apache#5722

Also fix a bug of creating dynamic history partitions, introduced from apache#5703
@morningman morningman mentioned this pull request May 8, 2021
10 tasks
morningman added a commit that referenced this pull request May 10, 2021
This bug is introduced from #5722

Also fix a bug of creating dynamic history partitions, introduced from #5703
EmmyMiao87 pushed a commit to EmmyMiao87/incubator-doris that referenced this pull request May 14, 2021
1. Add a new dynamic partition property `create_history_partition`.
    If set to true, Doris will create all partitions from `start` to `end`.

2. Add a new FE config `max_dynamic_partition_num`
    To limit the number of partitions created when creating one table.

Change-Id: I025772a8920423824335ffdac443c73af28f0cb1
EmmyMiao87 pushed a commit to EmmyMiao87/incubator-doris that referenced this pull request May 14, 2021
This bug is introduced from apache#5722

Also fix a bug of creating dynamic history partitions, introduced from apache#5703
@morningman morningman mentioned this pull request Oct 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-review Categorizes an issue or PR as actively needing an API review. approved Indicates a PR has been approved by one committer. area/catalog Issues or PRs related to catalog management

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants