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

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Version
   
   doris-2.1.1-rc05
   
   ### What's Wrong?
   
   自动分区和动态分区复用下的分区名一致性问题?
   
![image](https://github.com/apache/doris/assets/14345903/50d66240-26c1-488e-9b46-4cbb651f2622)
   
   
   ### What You Expected?
   
   创建一张表采用 了自动分区+扩展分区
   ```sql
   CREATE TABLE yxy_dcm_patient(
   
       hos_code VARCHAR(32) NOT NULL   COMMENT xxx' ,
       study_iuid VARCHAR(64) NOT NULL   COMMENT 'xxx' ,
       study_created_date datev2  NOT NULL   COMMENT 'xxx' ,
    ...
   )  
   ENGINE=OLAP
   UNIQUE KEY(`hos_code`,`study_iuid`,`study_created_date`)
   COMMENT 'xxx表'
   AUTO PARTITION BY RANGE (date_trunc(study_created_date,'MONTH')) ()
   DISTRIBUTED BY HASH(`hos_code`,`study_iuid`,`study_created_date`) BUCKETS 32
   PROPERTIES (
   "replication_allocation" = "tag.location.default: 1",
   "dynamic_partition.enable"="true",
   "dynamic_partition.time_unit"="MONTH",
   "dynamic_partition.end"="12",
   "dynamic_partition.prefix"="p",
   "dynamic_partition.buckets"="32"
   );
   ```
   当采用 study_created_date 采用分区类,创建动态分区,`PartitionName`分区名风格为以下:
   ```
   p202404
   p202405
   p202406
   
   ```
   当 插入历史数据时,会自动创建历史分区,但历史分区的 `PartitionName` 的名称与动态分区名称不统一风格,如自动创建的历史分区如下:
   ```
   p20230301000000
   ```
   这会导致如果SQL采用分区查询,容易无法统一分区的字段写法,如下SQL查询:
   ```sql
   select * from  yxy_dcm_patient partition(p202404)
   
   ```
   这就会导致自动创建的历史分区,不能以相同格式查询,目前自动分区支持的SQL函数,不支持截取,看能否优化下? 期望自动分区和动态分区的分区名保持相同的风格。
   
   ### How to Reproduce?
   
   _No response_
   
   ### Anything Else?
   
   _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: commits-unsubscr...@doris.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to