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

   ### 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
   
   2.0.1
   
   ### What's Wrong?
   
   
![Image](https://github.com/user-attachments/assets/7f3ca2f3-ccb2-400b-946a-e0aef374fec3)
   
   
![Image](https://github.com/user-attachments/assets/49a33398-2419-44c5-95c5-3d0e9d673e87)
   
   用来验证的表和对应的sql:
   drop table if exists py_test.test_sql;
   CREATE TABLE if not exists py_test.test_sql
   (
       date             date        not null comment '订单日期',
       order_id         varchar(64) not null comment '订单ID',
       project_name         varchar(64) not null comment '项目名'
   ) ENGINE = OLAP
       UNIQUE KEY(`date`,order_id)
   comment '测试索引的表'
   PARTITION BY RANGE(`date`)()
   DISTRIBUTED BY HASH(`date`) BUCKETS 1
   PROPERTIES (
   "enable_unique_key_merge_on_write" = "true",
   "dynamic_partition.enable" = "true",
   "dynamic_partition.time_unit" = "MONTH",
   "dynamic_partition.time_zone" = "UTC",
   "dynamic_partition.end" = "2",
   "dynamic_partition.prefix" = "p",
   "dynamic_partition.buckets" = "1",
   "dynamic_partition.create_history_partition" = "true",
   "dynamic_partition.history_partition_num" = "6",
   "dynamic_partition.hot_partition_num" = "0",
   "replication_num" = "1"
   );
   
   初始化数据:insert into py_test.test_sql
   values
       ('2025-04-22','123456','xxx测试项目'),
       ('2025-04-01','123457','xxx测试项目'),
       ('2025-03-22','123458','xxx测试项目'),
       ('2025-03-01','123459','xxx测试项目'),
       ('2025-02-22','1234510','xxx测试项目'),
       ('2025-02-01','1234511','xxx测试项目'),
       ('2025-01-22','1234512','xxx测试项目'),
       ('2025-01-01','1234513','xxx测试项目');
   
   
   insert into py_test.test_sql
   values
       ('2024-12-22','1234514','xxx测试项目'),
       ('2024-12-01','1234515','xxx测试项目'),
       ('2024-11-22','1234516','xxx测试项目'),
       ('2024-11-01','1234517','xxx测试项目');
   
   验证sql:
   explain
   select * from py_test.test_sql
            where date>=str_to_date('2025-03-01','%Y-%m-%d');
   explain
   select * from py_test.test_sql
   where date>='2025-03-01 10:00:00';
   
   ### What You Expected?
   
   期望 当explain
   select * from py_test.test_sql
            where date>=str_to_date('2025-03-01','%Y-%m-%d');  时 和 explain
   select * from py_test.test_sql
   where date>='2025-03-01 10:00:00'; 查询的分区数一致
   
   ### How to Reproduce?
   
   _No response_
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [x] 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