leeoo opened a new issue, #17013:
URL: https://github.com/apache/doris/issues/17013

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Description
   
   Support range partition by year with properties 
`"dynamic_partition.time_unit" = "YEAR"`.
   Support range partition by season with properties 
`"dynamic_partition.time_unit" = "SEASON"`.
   
   ### Use case
   
   Looks like below.
   
   ```SQL
   -- DROP TABLE IF EXISTS foobar;
   CREATE TABLE IF NOT EXISTS `foobar` (
     `id` bigint NOT NULL COMMENT '主键',
     `name` varchar(255) DEFAULT '' COMMENT '名称',
     `payment_date` date DEFAULT NULL COMMENT '支付时间',
     `payment_amount` varchar(255) DEFAULT '' COMMENT '支付金额',
     `remark` varchar(500) DEFAULT '' COMMENT '备注',
     `created_by` varchar(50) NOT NULL DEFAULT '' COMMENT '创建者',
     `updated_by` varchar(50) DEFAULT '' COMMENT '更新者',
     `created_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
     `updated_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
     `version` int DEFAULT '1' COMMENT '版本号,用于乐观锁更新',
     `deleted` int DEFAULT '0' COMMENT '是否删除,1 是,0 否,作为软删除标记'
   )
   ENGINE=OLAP
   DUPLICATE KEY(id)
   COMMENT "备案信息表"
   PARTITION BY RANGE(payment_date)
   (
       PARTITION p2016 VALUES LESS THAN ("2017-01-01"),
       PARTITION p2017 VALUES LESS THAN ("2018-01-01"),
       PARTITION p2018 VALUES LESS THAN ("2019-01-01"),
       PARTITION p2019 VALUES LESS THAN ("2020-01-01"),
       PARTITION p2020 VALUES LESS THAN ("2021-01-01"),
       PARTITION p2021 VALUES LESS THAN ("2022-01-01"),
       PARTITION p2022 VALUES LESS THAN ("2023-01-01")
       , PARTITION p2023 VALUES LESS THAN ("2024-01-01")
   )
   DISTRIBUTED BY HASH(id) BUCKETS 32
   PROPERTIES (
       "replication_num" = "3"
       ,"dynamic_partition.enable" = "true"
       **,"dynamic_partition.time_unit" = "YEAR"**
       ,"dynamic_partition.start" = "-10"
       ,"dynamic_partition.end" = "1"
       ,"dynamic_partition.prefix" = "p"
       ,"dynamic_partition.buckets" = "16"
   );
   ```
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to