ruanwenjun commented on code in PR #14815:
URL: 
https://github.com/apache/dolphinscheduler/pull/14815#discussion_r1306662943


##########
dolphinscheduler-task-plugin/dolphinscheduler-task-datax/src/main/java/org/apache/dolphinscheduler/plugin/task/datax/DataxTask.java:
##########
@@ -243,6 +243,31 @@ private List<ObjectNode> buildDataxJobContentJson() {
                 dataxTaskExecutionContext.getTargetType(),
                 dataxTaskExecutionContext.getTargetConnectionParams());
 
+        ObjectNode reader;
+        ObjectNode writer;
+
+        switch (dataxTaskExecutionContext.getSourcetype()) {
+            default:
+                reader = buildDataxJobContentJsonDefaultReader(dataSourceCfg);
+        }
+
+        switch (dataxTaskExecutionContext.getTargetType()) {
+            case DORIS:
+            default:
+                writer = buildDataxJobContentJsonDefaultWrite(dataSourceCfg, 
dataTargetCfg);
+        }
+
+        List<ObjectNode> contentList = new ArrayList<>();
+        ObjectNode content = JSONUtils.createObjectNode();
+        content.set("reader", reader);
+        content.set("writer", writer);
+        contentList.add(content);
+
+        return contentList;
+    }
+
+    private ObjectNode 
buildDataxJobContentJsonDefaultReader(BaseConnectionParam dataSourceCfg) {

Review Comment:
   Could you move this from DataXTask? and use a new interface to generate 
datax file content?



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