Skip to content

Conversation

@EmmyMiao87
Copy link
Contributor

Proposed changes

  • There is a fe configuration called dynamic_partition_enable
    which controls the opening and closing of the dynamic partition function.
    When this configuration is false, it means that all tables do not support dynamic partitioning.

  • But when the user tried to create the dynamic partition table, Doris did not detect this parameter.
    This will cause the user can normally create a dynamic partition table,
    but in fact Doris cannot create a partition for this table.

  • This pr detect this config when building the table.
    The dynamic partition table can be created only when the dynamic_partition_enable configuration is true.
    If the configuration is false, the command to create a dynamic partition table will directly report an error.

Fixed #5042

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 create an issue on (Fix #ISSUE), and have 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 this change need a document change, 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...

@EmmyMiao87 EmmyMiao87 added the area/catalog Issues or PRs related to catalog management label Dec 9, 2020
Copy link
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

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

We also need to forbid creating hour partition for date type column

Copy link
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

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

We also need to forbid creating hour partition for date type column

…c_partition_enable=false

- There is a fe configuration called dynamic_partition_enable
    which controls the opening and closing of the dynamic partition function.
  When this configuration is false, it means that all tables do not support dynamic partitioning.

- But when the user tried to create the dynamic partition table, Doris did not detect this parameter.
  This will cause the user can normally create a dynamic partition table,
    but in fact Doris cannot create a partition for this table.

- This pr detect this config when building the table.
  The dynamic partition table can be created only when the dynamic_partition_enable configuration is true.
  If the configuration is false, the command to create a dynamic partition table will directly report an error.

Fixed apache#5042
- When the user-specified dynamic partition time unit is hour,
    Doris will divide the partition every hour and automatically create and delete it.
  But if the data type of the specified partition column is DATE when the user creates the table,
    the partition creation will fail.
  Because the time accuracy of the date type is only up to days, the data cannot be divided by hour.

- So this pr directly prohibits this behavior when creating the table.
Copy link
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

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

LGTM

@morningman morningman merged commit 74bfd69 into apache:master Dec 16, 2020
morningman pushed a commit to baidu-doris/incubator-doris that referenced this pull request Jan 5, 2021
…dynamic_partition_enable=false (apache#5043)

- There is a fe configuration called dynamic_partition_enable
    which controls the opening and closing of the dynamic partition function.
  When this configuration is false, it means that all tables do not support dynamic partitioning.

- But when the user tried to create the dynamic partition table, Doris did not detect this parameter.
  This will cause the user can normally create a dynamic partition table,
    but in fact Doris cannot create a partition for this table.

- This pr detect this config when building the table.
  The dynamic partition table can be created only when the dynamic_partition_enable configuration is true.
  If the configuration is false, the command to create a dynamic partition table will directly report an error.
@yangzhg yangzhg mentioned this pull request Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/catalog Issues or PRs related to catalog management

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Doris does not create partition in dynamic partition table

2 participants