RaigorJiang commented on a change in pull request #12623:
URL: https://github.com/apache/shardingsphere/pull/12623#discussion_r715273491
##########
File path:
shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-distsql/shardingsphere-shadow-distsql-parser/src/main/java/org/apache/shardingsphere/shadow/distsql/parser/core/ShadowDistSQLStatementVisitor.java
##########
@@ -127,15 +128,18 @@ public ASTNode visitShowShadowTableRules(final
ShowShadowTableRulesContext ctx)
}
private static String getText(final ParserRuleContext ctx) {
+ if (null == ctx || ctx.isEmpty()) {
+ return null;
+ }
return new IdentifierValue(ctx.getText()).getValue();
}
private Collection<ShadowAlgorithmSegment> visitShadowAlgorithms(final
List<ShadowAlgorithmDefinitionContext> ctxs) {
return ctxs.stream().map(this::visit).map(each ->
(ShadowAlgorithmSegment) each).collect(Collectors.toList());
}
- private String createAlgorithmName(final String tableName, final
AlgorithmSegment algorithmSegment) {
- return (tableName + "_" + algorithmSegment.getName()).toLowerCase();
+ private String createAlgorithmName(final String ruleName, final String
tableName, final AlgorithmSegment algorithmSegment) {
+ return (ruleName + "_" + tableName + "_" +
algorithmSegment.getName()).toLowerCase();
Review comment:
Is it better to use String.format instead of `+`?
--
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]