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/02/04 02:27:03 UTC

[GitHub] [shardingsphere] jingshanglu opened a new pull request #9307: add exception for table rewrite error

jingshanglu opened a new pull request #9307:
URL: https://github.com/apache/shardingsphere/pull/9307


   Add exception for table rewrite error when routed table is not exist.
   


----------------------------------------------------------------
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] tristaZero commented on a change in pull request #9307: add exception for table rewrite error

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



##########
File path: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-route/src/main/java/org/apache/shardingsphere/sharding/route/strategy/type/standard/StandardShardingStrategy.java
##########
@@ -67,6 +68,8 @@ public StandardShardingStrategy(final String shardingColumn, final StandardShard
             target = shardingAlgorithm.doSharding(availableTargetNames, new PreciseShardingValue(shardingValue.getTableName(), shardingValue.getColumnName(), each));
             if (null != target && availableTargetNames.contains(target)) {
                 result.add(target);
+            } else if (null != target && !availableTargetNames.contains(target)) {
+                throw new ShardingSphereException(String.format("Route table %s is not exist, available actual table:%s", target, availableTargetNames));

Review comment:
       1. Route table %s does not exist, available actual table: %s
   2. `availableTargetNames` is a collection, so what's the string value of this variable? Does it not need `Strings.format()`?




----------------------------------------------------------------
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] tristaZero merged pull request #9307: add exception for table rewrite error

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


   


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