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 2020/01/01 08:10:07 UTC
[GitHub] [incubator-shardingsphere] HongJinFeng opened a new pull request
#3844: Support upper case logic table name of sharding configuration
HongJinFeng opened a new pull request #3844: Support upper case logic table name of sharding configuration
URL: https://github.com/apache/incubator-shardingsphere/pull/3844
Fixes #3635
Convert the field logicTable of class TableRuleConfiguration to lower case to support upper case logic table name, which is generated by the method org.apache.shardingsphere.core.yaml.swapper.impl.ShardingRuleConfigurationYamlSwapper#swap(org.apache.shardingsphere.core.yaml.config.sharding.YamlShardingRuleConfiguration)
----------------------------------------------------------------
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
With regards,
Apache Git Services
[GitHub] [incubator-shardingsphere] HongJinFeng commented on issue #3844:
Support upper case logic table name of sharding configuration
Posted by GitBox <gi...@apache.org>.
HongJinFeng commented on issue #3844: Support upper case logic table name of sharding configuration
URL: https://github.com/apache/incubator-shardingsphere/pull/3844#issuecomment-570167370
@haetao Thanks for review. Let me confirm.
----------------------------------------------------------------
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
With regards,
Apache Git Services
[GitHub] [incubator-shardingsphere] HongJinFeng closed pull request #3844:
Support upper case logic table name of sharding configuration
Posted by GitBox <gi...@apache.org>.
HongJinFeng closed pull request #3844: Support upper case logic table name of sharding configuration
URL: https://github.com/apache/incubator-shardingsphere/pull/3844
----------------------------------------------------------------
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
With regards,
Apache Git Services
[GitHub] [incubator-shardingsphere] haetao commented on issue #3844: Support
upper case logic table name of sharding configuration
Posted by GitBox <gi...@apache.org>.
haetao commented on issue #3844: Support upper case logic table name of sharding configuration
URL: https://github.com/apache/incubator-shardingsphere/pull/3844#issuecomment-570143330
@HongJinFeng Hi! I have no idea why use `toLowerCase()` for logicTable in class `TableRuleConfiguration`. `TableRuleConfiguration` is initialized before `TableRule`, but the `TableRule`
has already processed logicTable to lower case. This is repeated!
```
public TableRule(final TableRuleConfiguration tableRuleConfig, final ShardingDataSourceNames shardingDataSourceNames, final String defaultGenerateKeyColumn) {
logicTable = tableRuleConfig.getLogicTable().toLowerCase();
List<String> dataNodes = new InlineExpressionParser(tableRuleConfig.getActualDataNodes()).splitAndEvaluate();
dataNodeIndexMap = new HashMap<>(dataNodes.size(), 1);
actualDataNodes = isEmptyDataNodes(dataNodes)
? generateDataNodes(tableRuleConfig.getLogicTable(), shardingDataSourceNames.getDataSourceNames()) : generateDataNodes(dataNodes, shardingDataSourceNames.getDataSourceNames());
actualTables = getActualTables();
databaseShardingStrategy = null == tableRuleConfig.getDatabaseShardingStrategyConfig() ? null : ShardingStrategyFactory.newInstance(tableRuleConfig.getDatabaseShardingStrategyConfig());
tableShardingStrategy = null == tableRuleConfig.getTableShardingStrategyConfig() ? null : ShardingStrategyFactory.newInstance(tableRuleConfig.getTableShardingStrategyConfig());
generateKeyColumn = getGenerateKeyColumn(tableRuleConfig.getKeyGeneratorConfig(), defaultGenerateKeyColumn);
shardingKeyGenerator = containsKeyGeneratorConfiguration(tableRuleConfig)
? new ShardingKeyGeneratorServiceLoader().newService(tableRuleConfig.getKeyGeneratorConfig().getType(), tableRuleConfig.getKeyGeneratorConfig().getProperties()) : null;
checkRule(dataNodes);
}
```
```
public TableRuleConfiguration(final String logicTable, final String actualDataNodes) {
Preconditions.checkArgument(!Strings.isNullOrEmpty(logicTable), "LogicTable is required.");
this.logicTable = logicTable.toLowerCase();
this.actualDataNodes = actualDataNodes;
}
```
----------------------------------------------------------------
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
With regards,
Apache Git Services