This is an automated email from the ASF dual-hosted git repository.

jianglongtao pushed a commit to branch fix-33341
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git

commit 90afcfe5def4840e7900f5b669f77b0209e1f5a5
Author: RaigorJiang <[email protected]>
AuthorDate: Tue Aug 13 16:06:39 2024 +0800

    Pick #32489, fix load single table error after creating logical data source
---
 .../single/decorator/SingleRuleConfigurationDecorator.java  | 13 -------------
 1 file changed, 13 deletions(-)

diff --git 
a/kernel/single/core/src/main/java/org/apache/shardingsphere/single/decorator/SingleRuleConfigurationDecorator.java
 
b/kernel/single/core/src/main/java/org/apache/shardingsphere/single/decorator/SingleRuleConfigurationDecorator.java
index 21b50762a7b..30ea752e75d 100644
--- 
a/kernel/single/core/src/main/java/org/apache/shardingsphere/single/decorator/SingleRuleConfigurationDecorator.java
+++ 
b/kernel/single/core/src/main/java/org/apache/shardingsphere/single/decorator/SingleRuleConfigurationDecorator.java
@@ -68,7 +68,6 @@ public final class SingleRuleConfigurationDecorator 
implements RuleConfiguration
         Collection<String> excludedTables = 
SingleTableLoadUtils.getExcludedTables(builtRules);
         Map<String, Collection<DataNode>> actualDataNodes = 
SingleTableDataNodeLoader.load(databaseName, aggregatedDataSources, 
excludedTables);
         Collection<DataNode> configuredDataNodes = 
SingleTableLoadUtils.convertToDataNodes(databaseName, databaseType, 
splitTables);
-        checkRuleConfiguration(databaseName, aggregatedDataSources, 
excludedTables, configuredDataNodes);
         boolean isSchemaSupportedDatabaseType = new 
DatabaseTypeRegistry(databaseType).getDialectDatabaseMetaData().getDefaultSchema().isPresent();
         if (splitTables.contains(SingleTableConstants.ALL_TABLES) || 
splitTables.contains(SingleTableConstants.ALL_SCHEMA_TABLES)) {
             return loadAllTables(isSchemaSupportedDatabaseType, 
actualDataNodes);
@@ -152,18 +151,6 @@ public final class SingleRuleConfigurationDecorator 
implements RuleConfiguration
                 : formatTableName(dataNode.getDataSourceName(), 
dataNode.getTableName());
     }
     
-    private void checkRuleConfiguration(final String databaseName, final 
Map<String, DataSource> dataSources, final Collection<String> excludedTables, 
final Collection<DataNode> dataNodes) {
-        for (DataNode each : dataNodes) {
-            if 
(!SingleTableConstants.ASTERISK.equals(each.getDataSourceName())) {
-                
ShardingSpherePreconditions.checkState(dataSources.containsKey(each.getDataSourceName()),
-                        () -> new 
InvalidSingleRuleConfigurationException(String.format("Data source `%s` does 
not exist in database `%s`", each.getDataSourceName(), databaseName)));
-            }
-            
ShardingSpherePreconditions.checkState(!excludedTables.contains(each.getTableName()),
-                    () -> new 
InvalidSingleRuleConfigurationException(String.format("Table `%s` existed and 
is not a single table in database `%s`",
-                            each.getTableName(), databaseName)));
-        }
-    }
-    
     private String formatTableName(final String dataSourceName, final String 
tableName) {
         return String.format("%s.%s", dataSourceName, tableName);
     }

Reply via email to