Hisoka-X commented on code in PR #7677:
URL: https://github.com/apache/seatunnel/pull/7677#discussion_r1764314434


##########
seatunnel-engine/seatunnel-engine-core/src/main/java/org/apache/seatunnel/engine/core/parse/ConfigParserUtil.java:
##########
@@ -175,22 +175,44 @@ private static void checkComplexGraph(
 
     private static void fillVirtualVertices(
             List<? extends Config> configs,
-            Map<String, Tuple2<Config, VertexStatus>> vertexStatusMap) {
+            Map<String, Tuple2<Config, VertexStatus>> vertexStatusMap,
+            boolean isSource) {
+        Map<String, Tuple2<Config, VertexStatus>> transformVertexStatusMap = 
new HashMap<>();
         for (Config config : configs) {
-            vertexStatusMap.compute(
-                    config.getString(RESULT_TABLE_NAME.key()),
-                    (id, old) -> {
-                        if (old != null) {
-                            throw new JobDefineCheckException(
-                                    String.format(
-                                            "The value of the '%s' option of 
the (%s and %s) plugins is both '%s', and they must be different.",
-                                            RESULT_TABLE_NAME.key(),
-                                            
config.getString(PLUGIN_NAME.key()),
-                                            
old._1().getString(PLUGIN_NAME.key()),
-                                            id));
-                        }
-                        return new Tuple2<>(config, VertexStatus.CREATED);
-                    });
+            String resultTableName = config.getString(RESULT_TABLE_NAME.key());
+
+            if (isSource) {
+                vertexStatusMap.compute(
+                        resultTableName,
+                        (id, old) -> {
+                            if (old != null) {
+                                throw new JobDefineCheckException(
+                                        String.format(
+                                                "The value of the '%s' option 
of the (%s and %s) plugins is both '%s', and they must be different.",
+                                                RESULT_TABLE_NAME.key(),
+                                                
config.getString(PLUGIN_NAME.key()),
+                                                
old._1().getString(PLUGIN_NAME.key()),
+                                                id));
+                            }
+                            return new Tuple2<>(config, VertexStatus.CREATED);
+                        });
+            } else {
+                if (vertexStatusMap.containsKey(resultTableName)) {

Review Comment:
   ```
   source {
     # This is a example source plugin **only for test and demonstrate the 
feature source plugin**
     FakeSource {
       result_table_name = "fake"
       schema {
         fields {
           id = "int"
           name = "string"
           age = "int"
         }
       }
     }
   
     FakeSource {
       result_table_name = "fake"
       schema {
         fields {
           id = "int"
           name = "string"
           age = "int"
         }
       }
     }
   }
   transform {
   }
   sink {
     console {
       source_table_name=fake
     }
   
   }
   ```
   
   I think we should support two sources to one sink without transform too.



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