From 37939add0cc5472f2757fb651d53359c850c3dfe Mon Sep 17 00:00:00 2001 From: fuchanghai <33984497+fuchanghai@users.noreply.github.com> Date: Thu, 9 Feb 2023 19:02:27 +0800 Subject: [PATCH] [fix-13492]add single quotes (#13534) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [fix-13492]add single quotes * [improve-#13201] fix test error --------- Co-authored-by: fuchanghai <‘2875334588@qq.com’> --- .../apache/dolphinscheduler/plugin/task/datax/DataxTask.java | 2 +- .../dolphinscheduler/plugin/task/datax/DataxTaskTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-datax/src/main/java/org/apache/dolphinscheduler/plugin/task/datax/DataxTask.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-datax/src/main/java/org/apache/dolphinscheduler/plugin/task/datax/DataxTask.java index 722cace03c..53bd2a1871 100644 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-datax/src/main/java/org/apache/dolphinscheduler/plugin/task/datax/DataxTask.java +++ b/dolphinscheduler-task-plugin/dolphinscheduler-task-datax/src/main/java/org/apache/dolphinscheduler/plugin/task/datax/DataxTask.java @@ -84,7 +84,7 @@ public class DataxTask extends AbstractTask { */ public static final String JVM_PARAM = " --jvm=\"-Xms%sG -Xmx%sG\" "; - public static final String CUSTOM_PARAM = " -D%s=%s"; + public static final String CUSTOM_PARAM = " -D%s='%s'"; /** * python process(datax only supports version 2.7 by default) */ diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-datax/src/test/java/org/apache/dolphinscheduler/plugin/task/datax/DataxTaskTest.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-datax/src/test/java/org/apache/dolphinscheduler/plugin/task/datax/DataxTaskTest.java index 9977d237c6..08c8d5466e 100644 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-datax/src/test/java/org/apache/dolphinscheduler/plugin/task/datax/DataxTaskTest.java +++ b/dolphinscheduler-task-plugin/dolphinscheduler-task-datax/src/test/java/org/apache/dolphinscheduler/plugin/task/datax/DataxTaskTest.java @@ -157,7 +157,7 @@ public class DataxTaskTest { InputStream shellCommandInputStream = Files.newInputStream(shellCommandFile.toPath()); String shellCommandStr = FileUtils.readFile2Str(shellCommandInputStream); Assertions.assertEquals(shellCommandStr, "python2.7 ${DATAX_HOME}/bin/datax.py --jvm=\"-Xms1G -Xmx1G\" " + - "-p \"-DDT=DT -DDS=DS\" /tmp/execution/app-id_job.json"); + "-p \"-DDT='DT' -DDS='DS'\" /tmp/execution/app-id_job.json"); delete = shellCommandFile.delete(); Assertions.assertTrue(delete); }