You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/06/01 08:37:37 UTC

[GitHub] [shardingsphere] lichencai opened a new issue, #18128: shardingsphere5.1.1 INTERVAL algorithm

lichencai opened a new issue, #18128:
URL: https://github.com/apache/shardingsphere/issues/18128

   ## Question
   
   I use interval algorithm by the properties like this
   
   ```
   spring:
     shardingsphere:
       mode:
         type: Standalone
         repository:
           type: File
           props:
             path: .shardingsphere
         overwrite: true
       datasource:
         names: test-algorithm
         test-algorithm:
           type: com.alibaba.druid.pool.DruidDataSource
           driver-class-name: com.mysql.jdbc.Driver
           url: jdbc:mysql://localhost:3306/test_algorithm?useUnicode=true&characterEncoding=utf-8&rewriteBatchedStatements=true&serverTimezone=Asia/Shanghai
           username: test
           password: test
           maxPoolSize: 100
           minPoolSize: 5
       rules:
         sharding:
           tables:
             metic_text_record:
               actual-data-nodes: test-algorithm.metic_text_record$->{202201..203012}
               table-strategy:
                 standard:
                   sharding-column: create_time
                   sharding-algorithm-name: myalgorithm
           sharding-algorithms:
             myalgorithm:
               type: INTERVAL
               props:
                 datetime-pattern: 'yyyy-MM-dd HH:mm:ss'
                 datetime-lower: '2022-01-01 00:00:00'
                 datetime-upper: '2023-12-01 00:00:00'
                 sharding-suffix-pattern: 'yyyyMM'
                 datetime-interval-amount: 1
                 datetime-interval-unit: 'months'
   ```
   
   when the program use current time to format, it throws an error that StringIndexOutOfBoundsException
   ![image](https://user-images.githubusercontent.com/5958344/171363357-86790633-40c0-4dcc-bdf9-8b6aa5de424d.png)
   ![image](https://user-images.githubusercontent.com/5958344/171363434-0e186ecf-f962-4dcd-aa4b-d45e309ab619.png)
   
   
   why the current time's pattern like ‘2022-06-01’ but not '2022-06-01 16:00:00'
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org.apache.org

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


[GitHub] [shardingsphere] linghengqian commented on issue #18128: shardingsphere5.1.1 INTERVAL algorithm

Posted by GitBox <gi...@apache.org>.
linghengqian commented on issue #18128:
URL: https://github.com/apache/shardingsphere/issues/18128#issuecomment-1143407003

   - Duplicated with https://github.com/apache/shardingsphere/issues/17752 , https://github.com/apache/shardingsphere/issues/16738 and https://github.com/apache/shardingsphere/issues/17948 . 
   
   - This issue should be turned off. The master branch's `org.apache.shardingsphere.sharding.algorithm.sharding.datetime.IntervalShardingAlgorithm` can be ported to `5.1.1` in the form of CLASS_BASE` custom sharding algorithms .


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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


[GitHub] [shardingsphere] terrymanu closed issue #18128: shardingsphere5.1.1 INTERVAL algorithm

Posted by GitBox <gi...@apache.org>.
terrymanu closed issue #18128: shardingsphere5.1.1 INTERVAL algorithm
URL: https://github.com/apache/shardingsphere/issues/18128


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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