Beyondeclipse commented on a change in pull request #11345:
URL: https://github.com/apache/shardingsphere/pull/11345#discussion_r673981572



##########
File path: 
shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/metadata/schema/builder/SchemaBuilder.java
##########
@@ -84,43 +89,45 @@
     
     private static Map<String, TableMetaData> 
buildActualTableMetaDataMap(final SchemaBuilderMaterials materials) throws 
SQLException {
         Map<String, TableMetaData> result = new 
HashMap<>(materials.getRules().size(), 1);
-        appendRemainTables(materials, result);
-        for (ShardingSphereRule rule : materials.getRules()) {
-            if (rule instanceof TableContainedRule) {
-                for (String table : ((TableContainedRule) rule).getTables()) {
-                    if (!result.containsKey(table)) {
-                        TableMetaDataBuilder.load(table, 
materials).map(optional -> result.put(table, optional));
+        Collection<String> ruleLogicTables = materials.getRules().stream()
+                .filter(rule -> rule instanceof TableContainedRule)
+                .flatMap(rule -> ((TableContainedRule) 
rule).getTables().stream())
+                .collect(Collectors.toSet());
+        appendRemainTables(materials, result, ruleLogicTables);

Review comment:
       > @Beyondeclipse If you adjust the order of execution, the result 
parameter will contain the rule table.
   
   Can you give more explanation ?




-- 
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