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 2021/06/14 08:07:17 UTC

[GitHub] [shardingsphere] jianliu opened a new pull request #10804: Fix insert or query by precise value error when there is no db ShardingStrategy and using unique table names

jianliu opened a new pull request #10804:
URL: https://github.com/apache/shardingsphere/pull/10804


   Fixes #10746.
   
   Changes proposed in this pull request:
   - IntervalShardingAlgorithm`s method doSharding(...) do not throw exception directly,if no matched target just return null
   - Optimized code of  IntervalShardingAlgorithm and AutoIntervalShardingAlgorithm ,reduce the times of dataTime parser
   


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



[GitHub] [shardingsphere] strongduanmu merged pull request #10804: Fix insert or query by precise value error when there is no db ShardingStrategy and using unique table names

Posted by GitBox <gi...@apache.org>.
strongduanmu merged pull request #10804:
URL: https://github.com/apache/shardingsphere/pull/10804


   


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



[GitHub] [shardingsphere] jianliu commented on a change in pull request #10804: Fix insert or query by precise value error when there is no db ShardingStrategy and using unique table names

Posted by GitBox <gi...@apache.org>.
jianliu commented on a change in pull request #10804:
URL: https://github.com/apache/shardingsphere/pull/10804#discussion_r651407146



##########
File path: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/datetime/AutoIntervalShardingAlgorithm.java
##########
@@ -84,8 +84,9 @@ private long getShardingSeconds() {
     
     @Override
     public String doSharding(final Collection<String> availableTargetNames, final PreciseShardingValue<Comparable<?>> shardingValue) {
+        String shardingValSuffix = String.valueOf(doSharding(parseDate(shardingValue.getValue())));

Review comment:
       ok,I`ll change it. 

##########
File path: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/datetime/IntervalShardingAlgorithm.java
##########
@@ -121,9 +120,10 @@ private ChronoUnit getStepUnit(final String stepUnit) {
     
     @Override
     public String doSharding(final Collection<String> availableTargetNames, final PreciseShardingValue<Comparable<?>> shardingValue) {
+        String shardingValSuffix = parseDateTime(shardingValue.getValue().toString()).format(tableSuffixPattern);

Review comment:
       ok,I`ll change it. 




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



[GitHub] [shardingsphere] codecov-commenter commented on pull request #10804: Fix insert or query by precise value error when there is no db ShardingStrategy and using unique table names

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #10804:
URL: https://github.com/apache/shardingsphere/pull/10804#issuecomment-860450813


   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/10804?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#10804](https://codecov.io/gh/apache/shardingsphere/pull/10804?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ed42ab0) into [master](https://codecov.io/gh/apache/shardingsphere/commit/18c2f32beea2dae9bac5b20935abca07b4ed421b?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (18c2f32) will **increase** coverage by `0.00%`.
   > The diff coverage is `100.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/10804/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/shardingsphere/pull/10804?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff            @@
   ##             master   #10804   +/-   ##
   =========================================
     Coverage     65.60%   65.60%           
     Complexity      693      693           
   =========================================
     Files          1779     1779           
     Lines         30821    30823    +2     
     Branches       5560     5560           
   =========================================
   + Hits          20219    20221    +2     
     Misses         8990     8990           
     Partials       1612     1612           
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/10804?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...arding/datetime/AutoIntervalShardingAlgorithm.java](https://codecov.io/gh/apache/shardingsphere/pull/10804/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvYWxnb3JpdGhtL3NoYXJkaW5nL2RhdGV0aW1lL0F1dG9JbnRlcnZhbFNoYXJkaW5nQWxnb3JpdGhtLmphdmE=) | `84.61% <100.00%> (+0.40%)` | :arrow_up: |
   | [...m/sharding/datetime/IntervalShardingAlgorithm.java](https://codecov.io/gh/apache/shardingsphere/pull/10804/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvYWxnb3JpdGhtL3NoYXJkaW5nL2RhdGV0aW1lL0ludGVydmFsU2hhcmRpbmdBbGdvcml0aG0uamF2YQ==) | `80.43% <100.00%> (+0.43%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/10804?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/10804?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [18c2f32...ed42ab0](https://codecov.io/gh/apache/shardingsphere/pull/10804?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


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



[GitHub] [shardingsphere] strongduanmu commented on a change in pull request #10804: Fix insert or query by precise value error when there is no db ShardingStrategy and using unique table names

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on a change in pull request #10804:
URL: https://github.com/apache/shardingsphere/pull/10804#discussion_r651406199



##########
File path: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/datetime/AutoIntervalShardingAlgorithm.java
##########
@@ -84,8 +84,9 @@ private long getShardingSeconds() {
     
     @Override
     public String doSharding(final Collection<String> availableTargetNames, final PreciseShardingValue<Comparable<?>> shardingValue) {
+        String shardingValSuffix = String.valueOf(doSharding(parseDate(shardingValue.getValue())));

Review comment:
       @jianliu tableNameSuffix may be better.

##########
File path: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/datetime/IntervalShardingAlgorithm.java
##########
@@ -121,9 +120,10 @@ private ChronoUnit getStepUnit(final String stepUnit) {
     
     @Override
     public String doSharding(final Collection<String> availableTargetNames, final PreciseShardingValue<Comparable<?>> shardingValue) {
+        String shardingValSuffix = parseDateTime(shardingValue.getValue().toString()).format(tableSuffixPattern);

Review comment:
       @jianliu tableNameSuffix may be better.




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



[GitHub] [shardingsphere] strongduanmu commented on pull request #10804: Fix insert or query by precise value error when there is no db ShardingStrategy and using unique table names

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on pull request #10804:
URL: https://github.com/apache/shardingsphere/pull/10804#issuecomment-862120898


   @jianliu Great job, merged. 👍


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