This is an automated email from the ASF dual-hosted git repository.
duanzhengqiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new ae0d33f13c4 keep auto tables actual datanode order as older version
(#18628)
ae0d33f13c4 is described below
commit ae0d33f13c4ba81aa6c8637f889ae5a879e9a593
Author: Chuxin Chen <[email protected]>
AuthorDate: Mon Jun 27 16:13:09 2022 +0800
keep auto tables actual datanode order as older version (#18628)
---
.../rule/ShardingAutoTableRuleConfigurationYamlSwapper.java | 9 +--------
.../visitor/statement/impl/OpenGaussDDLStatementSQLVisitor.java | 2 +-
2 files changed, 2 insertions(+), 9 deletions(-)
diff --git
a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/yaml/swapper/rule/ShardingAutoTableRuleConfigurationYamlSwapper.java
b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/yaml/swapper/rule/ShardingAutoTableRuleConfigurationYamlSwapper.java
index e20ad40e04f..a49aa9f5870 100644
---
a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/yaml/swapper/rule/ShardingAutoTableRuleConfigurationYamlSwapper.java
+++
b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/yaml/swapper/rule/ShardingAutoTableRuleConfigurationYamlSwapper.java
@@ -32,8 +32,6 @@ import
org.apache.shardingsphere.sharding.yaml.swapper.strategy.KeyGenerateStrat
import
org.apache.shardingsphere.sharding.yaml.swapper.strategy.ShardingStrategyConfigurationYamlSwapper;
import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
import java.util.Map;
import java.util.Optional;
@@ -116,12 +114,7 @@ public final class
ShardingAutoTableRuleConfigurationYamlSwapper implements Yaml
}
private String getActualDataNodes(final ShardingAutoTableRuleConfiguration
data, final int shardingCount) {
- Collection<String> dataSourceNames =
getDataSourceNames(data.getActualDataSources());
+ Collection<String> dataSourceNames = new
InlineExpressionParser(data.getActualDataSources()).splitAndEvaluate();
return String.join(",", DataNodeUtil.getFormatDataNodes(shardingCount,
data.getLogicTable(), dataSourceNames));
}
-
- private Collection<String> getDataSourceNames(final String dataSources) {
- List<String> actualDataSources = new
InlineExpressionParser(dataSources).splitAndEvaluate();
- return new HashSet<>(actualDataSources);
- }
}
diff --git
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-opengauss/src/main/java/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/impl/OpenGaussDDLStatementSQLVisitor.java
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-opengauss/src/main/java/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/impl/OpenGaussDDLStatementSQLVisitor.java
index 4b6e8169ddf..0295f816de5 100644
---
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-opengauss/src/main/java/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/impl/OpenGaussDDLStatementSQLVisitor.java
+++
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-opengauss/src/main/java/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/impl/OpenGaussDDLStatementSQLVisitor.java
@@ -646,7 +646,7 @@ public final class OpenGaussDDLStatementSQLVisitor extends
OpenGaussStatementSQL
result.setIfExists(null != ctx.ifExists());
return result;
}
-
+
@Override
public ASTNode visitDropServer(final DropServerContext ctx) {
return new OpenGaussDropServerStatement();