strongduanmu commented on code in PR #21346:
URL: https://github.com/apache/shardingsphere/pull/21346#discussion_r991840038


##########
features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/route/engine/type/standard/ShardingStandardRoutingEngine.java:
##########
@@ -94,6 +98,17 @@ private boolean isRoutingByHint(final ShardingRule 
shardingRule, final TableRule
                 && 
shardingRule.getTableShardingStrategyConfiguration(tableRule) instanceof 
HintShardingStrategyConfiguration;
     }
     
+    private boolean isRoutingBySQLHint() {
+        boolean result = false;
+        if (sqlStatementContext instanceof CommonSQLStatementContext) {
+            Collection<String> tableNames = 
sqlStatementContext.getTablesContext().getTableNames();
+            for (String each : tableNames) {
+                result = result || ((CommonSQLStatementContext<?>) 
sqlStatementContext).containsHintShardingValue(each);

Review Comment:
   Can you use guard clause here? Just like:
   
   ```java
   if (CommonSQLStatementContext<?>) 
sqlStatementContext).containsHintShardingValue(each) {
   return true;
   }
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to