macdoor commented on code in PR #17987:
URL:
https://github.com/apache/dolphinscheduler/pull/17987#discussion_r2846814372
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-flink/src/main/java/org/apache/dolphinscheduler/plugin/task/flink/FlinkTask.java:
##########
@@ -57,6 +62,21 @@ public FlinkTask(TaskExecutionContext taskExecutionContext) {
public void init() {
flinkParameters =
JSONUtils.parseObject(taskExecutionContext.getTaskParams(),
FlinkParameters.class);
+ // Replace parameter placeholders (e.g. ${system.biz.date},
$[yyyyMMdd]) in init script and main script
+ if (flinkParameters != null) {
+ Map<String, Property> paramsMap =
taskExecutionContext.getPrepareParamsMap();
+ Map<String, String> stringParams =
ParameterUtils.convert(paramsMap);
+
+ if (StringUtils.isNotBlank(flinkParameters.getInitScript())) {
+ flinkParameters.setInitScript(
+
ParameterUtils.convertParameterPlaceholders(flinkParameters.getInitScript(),
stringParams));
+ }
+ if (StringUtils.isNotBlank(flinkParameters.getRawScript())) {
+ flinkParameters.setRawScript(
+
ParameterUtils.convertParameterPlaceholders(flinkParameters.getRawScript(),
stringParams));
+ }
+ }
Review Comment:
solved. thx
--
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]