dongzl commented on issue #29353:
URL: 
https://github.com/apache/shardingsphere/issues/29353#issuecomment-1866432752

   Hi @chly1103 , I debug the code, the `actualDataNodes` maybe wrong.
   
   It should config 
`<INTERVAL>P=ds_0.t_order_;SP=yyyyMM;DIA=1;DIU=Months;DL=202311;DU=202401`
   
   you can try it.
   
   ```
   databaseName: sharding_interval
   
   dataSources:
     ds_0:
       url: jdbc:mysql://127.0.0.1:3307/db_mall_0?useSSL=false
       username: root
       password: 123456
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
   
   rules:
   - !SHARDING
     tables:
       t_order:
         #actualDataNodes: ds_0.t_order_$->{202315..202401}
         actualDataNodes: 
<INTERVAL>P=ds_0.t_order_;SP=yyyyMM;DIA=1;DIU=Months;DL=202311;DU=202401
         tableStrategy:
           standard:
             shardingColumn: create_time
             shardingAlgorithmName: sharding_by_time
         keyGenerateStrategy:
           column: id
           keyGeneratorName: snowflake
   
     shardingAlgorithms:
       sharding_by_time:
         type: INTERVAL
         props:
           datetime-pattern: "yyyy-MM-dd HH:mm:ss"
           datetime-lower: "2023-01-01 00:00:00"
           datetime-upper: "2099-12-31 23:59:59"
           sharding-suffix-pattern: "yyyyMM"
           datetime-interval-amount: 1
           datetime-interval-unit: "MONTHS"
   
     keyGenerators:
       snowflake:
         type: SNOWFLAKE
   ```
   <img width="248" alt="image" 
src="https://github.com/apache/shardingsphere/assets/5917359/238daf33-c0ce-4a43-aa91-5b9cbbc8a060";>
   


-- 
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]

Reply via email to