-
Notifications
You must be signed in to change notification settings - Fork 5k
Description
Search before asking
- I had searched in the issues and found no similar issues.
What happened
Datax shell cannot run when 'Global Variables' contains space in Workflow Definition(I can't access the production environment right now to provide detailed exception information and screenshot). eg:
'Global Variables' name: std.start.time
The value of the first type global variable:$[yyyy-MM-dd HH:00:00]
The value of the second type global variable(Added single quotes):'$[yyyy-MM-dd HH:00:00]'
The first type of DS generated Datax shell scripts:
${PYTHON_LAUNCHER} ${DATAX_LAUNCHER} --jvm="-Xms1G -Xmx1G" -p "-Dstd.start.time='2023-10-26 14:00:00' -DStartParams='{"std.start.time":"2023-10-26 14:00:00"}'
The Dstd.start.time value has single quotes,and std.start.time in DStartParams doesn‘t have single quotes. The Datax shell can't run success.
The second type of DS generated Datax shell scripts:
${PYTHON_LAUNCHER} ${DATAX_LAUNCHER} --jvm="-Xms1G -Xmx1G" -p "-Dstd.start.time=''2023-10-26 14:00:00'' -DStartParams='{"std.start.time":"'2023-10-26 14:00:00'"}'
The Dstd.start.time value has DOUBLE single quotes.Datax shell also doesn't work.
What you expected to happen
I found that the CUSTOM_PARAM attribute in the org.apache.dolphinscheduler.plugin.task.datax.DataxTask class adds the single quote:
public static final String CUSTOM_PARAM = " -D%s='%s'";
It works fine after this modification (the code is poorly written):

How to reproduce
Use global variables with spaces value in process definitions that contain Datax tasks
Anything else
no
Version
3.2.x
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct