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/05/31 15:28:43 UTC

[GitHub] [shardingsphere] yx9o opened a new pull request, #18108: SHOW `SHARDING TABLE RULES USED ALGORITHM` not display tables used default strategy.

yx9o opened a new pull request, #18108:
URL: https://github.com/apache/shardingsphere/pull/18108

   Fixes #18099 .
   
   


-- 
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] RaigorJiang merged pull request #18108: Fix `SHOW SHARDING TABLE RULES USED ALGORITHM` not display tables used default strategy.

Posted by GitBox <gi...@apache.org>.
RaigorJiang merged PR #18108:
URL: https://github.com/apache/shardingsphere/pull/18108


-- 
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] TeslaCN commented on pull request #18108: Fix `SHOW SHARDING TABLE RULES USED ALGORITHM` not display tables used default strategy.

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on PR #18108:
URL: https://github.com/apache/shardingsphere/pull/18108#issuecomment-1144345728

   Hi @RaigorJiang @yx9o 
   Any update here?


-- 
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] RaigorJiang commented on pull request #18108: Fix `SHOW SHARDING TABLE RULES USED ALGORITHM` not display tables used default strategy.

Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on PR #18108:
URL: https://github.com/apache/shardingsphere/pull/18108#issuecomment-1144384467

   > Hi @RaigorJiang @yx9o Any update here?
   
   @yx9o will update soon.


-- 
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] codecov-commenter commented on pull request #18108: Fix `SHOW SHARDING TABLE RULES USED ALGORITHM` not display tables used default strategy.

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

   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/18108?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 [#18108](https://codecov.io/gh/apache/shardingsphere/pull/18108?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (46d7cd0) into [master](https://codecov.io/gh/apache/shardingsphere/commit/e2eb68d2faf1b0b1c7fd0fa31a42b4ae377349c5?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e2eb68d) will **decrease** coverage by `0.01%`.
   > The diff coverage is `11.11%`.
   
   > :exclamation: Current head 46d7cd0 differs from pull request most recent head 21ac7e5. Consider uploading reports for the commit 21ac7e5 to get more accurate results
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #18108      +/-   ##
   ============================================
   - Coverage     59.06%   59.05%   -0.02%     
     Complexity     2165     2165              
   ============================================
     Files          3682     3682              
     Lines         54172    54178       +6     
     Branches       9199     9204       +5     
   ============================================
   - Hits          31995    31993       -2     
   - Misses        19459    19462       +3     
   - Partials       2718     2723       +5     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/18108?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ShardingTableRulesUsedAlgorithmQueryResultSet.java](https://codecov.io/gh/apache/shardingsphere/pull/18108/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctZGlzdHNxbC9zaGFyZGluZ3NwaGVyZS1zaGFyZGluZy1kaXN0c3FsLWhhbmRsZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NoYXJkaW5nL2Rpc3RzcWwvaGFuZGxlci9xdWVyeS9TaGFyZGluZ1RhYmxlUnVsZXNVc2VkQWxnb3JpdGhtUXVlcnlSZXN1bHRTZXQuamF2YQ==) | `56.66% <11.11%> (-10.00%)` | :arrow_down: |
   | [...d/text/distsql/ral/common/hint/HintSourceType.java](https://codecov.io/gh/apache/shardingsphere/pull/18108/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-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC90ZXh0L2Rpc3RzcWwvcmFsL2NvbW1vbi9oaW50L0hpbnRTb3VyY2VUeXBlLmphdmE=) | `0.00% <0.00%> (-42.86%)` | :arrow_down: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/18108?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/18108?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 [e2eb68d...21ac7e5](https://codecov.io/gh/apache/shardingsphere/pull/18108?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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

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


[GitHub] [shardingsphere] RaigorJiang commented on a diff in pull request #18108: Fix `SHOW SHARDING TABLE RULES USED ALGORITHM` not display tables used default strategy.

Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on code in PR #18108:
URL: https://github.com/apache/shardingsphere/pull/18108#discussion_r886340471


##########
shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShardingTableRulesUsedAlgorithmQueryResultSet.java:
##########
@@ -49,14 +49,20 @@ private void requireResult(final ShowShardingTableRulesUsedAlgorithmStatement st
         if (!statement.getAlgorithmName().isPresent()) {
             return;
         }
+        String algorithmName = statement.getAlgorithmName().get();
+        boolean matchDefaultDatabaseShardingStrategy = null != shardingRuleConfig.getDefaultDatabaseShardingStrategy()
+                && algorithmName.equals(shardingRuleConfig.getDefaultDatabaseShardingStrategy().getShardingAlgorithmName());
+        boolean matchDefaultTableShardingStrategy = null != shardingRuleConfig.getDefaultTableShardingStrategy()
+                && algorithmName.equals(shardingRuleConfig.getDefaultTableShardingStrategy().getShardingAlgorithmName());
         shardingRuleConfig.getTables().forEach(each -> {
-            if (((null != each.getDatabaseShardingStrategy() && statement.getAlgorithmName().get().equals(each.getDatabaseShardingStrategy().getShardingAlgorithmName())))
-                    || (null != each.getTableShardingStrategy() && statement.getAlgorithmName().get().equals(each.getTableShardingStrategy().getShardingAlgorithmName()))) {
+            if (((null != each.getDatabaseShardingStrategy() && algorithmName.equals(each.getDatabaseShardingStrategy().getShardingAlgorithmName())))
+                    || (null != each.getTableShardingStrategy() && algorithmName.equals(each.getTableShardingStrategy().getShardingAlgorithmName()))
+                    || (null == each.getDatabaseShardingStrategy() && null == each.getTableShardingStrategy() && (matchDefaultDatabaseShardingStrategy || matchDefaultTableShardingStrategy))) {

Review Comment:
   `databaseShardingStrategy` and `tableShardingStrategy` are not necessarily null at the same time.



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