lvyanquan commented on code in PR #3753:
URL: https://github.com/apache/flink-cdc/pull/3753#discussion_r1856105145


##########
flink-cdc-cli/src/main/java/org/apache/flink/cdc/cli/parser/YamlPipelineDefinitionParser.java:
##########
@@ -323,4 +335,27 @@ private Configuration toPipelineConfig(JsonNode 
pipelineConfigNode) {
                         pipelineConfigNode, new TypeReference<Map<String, 
String>>() {});
         return Configuration.fromMap(pipelineConfigMap);
     }
+
+    private List<ModelDef> parseModels(JsonNode modelsNode) {
+        List<ModelDef> modelDefs = new ArrayList<>();
+        if (modelsNode != null && modelsNode.isArray()) {
+            for (JsonNode modelNode : modelsNode) {
+                String name =
+                        checkNotNull(
+                                        modelNode.get(MODEL_NAME_KEY),
+                                        "Missing required field \"%s\" in 
Model",
+                                        MODEL_NAME_KEY)
+                                .asText();
+                String model =
+                        checkNotNull(
+                                        modelNode.get(MODEL_MODEL_KEY),
+                                        "Missing required field \"%s\" in 
Model",
+                                        MODEL_MODEL_KEY)
+                                .asText();
+                Map<String, String> properties = 
mapper.convertValue(modelNode, Map.class);
+                modelDefs.add(new ModelDef(name, model, properties));
+            }
+        }

Review Comment:
   Done. 
   Support array and single element. 



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