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 2020/12/30 15:42:44 UTC

[GitHub] [shardingsphere] strongduanmu commented on issue #8827: ShardingSphereConfigurationException: Invalid datetime-lower, datetime pattern should be `yyyy-MM-dd`, value is `2018-06-01`

strongduanmu commented on issue #8827:
URL: https://github.com/apache/shardingsphere/issues/8827#issuecomment-752666697


   @lwh-0739 Hello, thank you very much for your feedback. 😊 Just like the code you showed, the interval sharding algorithm is implemented based on `LocalDateTime`, which requires us to define parameters in the datatime format. You can adjust the configuration to avoid this error:
   
   ```properties
   spring.shardingsphere.rules.sharding.sharding-algorithms.test.type=INTERVAL
   spring.shardingsphere.rules.sharding.sharding-algorithms.test.props.datetime-pattern=yyyy-MM-dd HH:mm:ss
   spring.shardingsphere.rules.sharding.sharding-algorithms.test.props.sharding-suffix-pattern=yyyyMM
   spring.shardingsphere.rules.sharding.sharding-algorithms.test.props.datetime-lower=2018-06-01 00:00:00
   spring.shardingsphere.rules.sharding.sharding-algorithms.test.props.datetime-upper=2021-12-31 00:00:00
   spring.shardingsphere.rules.sharding.sharding-algorithms.test.props.datetime-interval-amount=6
   spring.shardingsphere.rules.sharding.sharding-algorithms.test.props.datetime-interval-unit=MONTHS
   ```
   In addition, you can also implement custom algorithms through SPI to meet your needs.
   


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

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