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

   ### 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.6
   
   ### What's Wrong?
   
   When creating a table with dynamic partitioning in Doris, the generated 
partitions include an extra day component (e.g., '20250201' instead of 
'202502'). This causes insertions with the expected year_month format to fail 
due to missing partitions.
   
   ### What You Expected?
   
   The partitions should be created with the year_month values as integers 
representing the year and month (e.g., '202502'), without the extra day 
component.
   
   ### How to Reproduce?
   
   1. Create a table with dynamic partitioning set to partition by month.
   ```sql
   CREATE TABLE `test_tbl` (
     `year_month` int(11) NOT NULL,
     `unique_product_id` varchar NOT NULL 
   ) ENGINE=OLAP
   UNIQUE KEY(`year_month`,`unique_product_id`)
   PARTITION BY RANGE(`year_month`)
   (
    PARTITION p_initial VALUES LESS THAN (202201)
   )
   DISTRIBUTED BY HASH(`unique_product_id`) BUCKETS 16
   PROPERTIES (
   "dynamic_partition.enable" = "true",
   "dynamic_partition.time_unit" = "month",
   "dynamic_partition.start" = "-25",
   "dynamic_partition.end" = "2",
   "dynamic_partition.prefix" = "p",
   "dynamic_partition.buckets" = "16",
   "replication_num" = "3",
   "in_memory" = "false",
   "storage_format" = "V2"
   );
   ```
   2.Execute SHOW CREATE TABLE to view the partition definitions.
   3. Attempt to insert data with a year_month value expected to fit into a 
created partition.
   ```sql
   insert into test_tbl (year_month, unique_product_id) values ('202503', 
'1232');
   ```
   5. Observe the error indicating no partition exists for the tuple.
   ```
   Reason: no partition for this tuple.
   ```
   
   ### 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: 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