From 13fefd0607de23385715373eb67b937bcf5a3cac Mon Sep 17 00:00:00 2001 From: CalvinKirs Date: Wed, 16 Dec 2020 13:10:45 +0800 Subject: [PATCH] fix time cover --- .../dolphinscheduler/server/worker/task/shell/ShellTask.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/shell/ShellTask.java b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/shell/ShellTask.java index 387df4685a..57ca3b3c05 100644 --- a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/shell/ShellTask.java +++ b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/shell/ShellTask.java @@ -41,6 +41,7 @@ import java.nio.file.StandardOpenOption; import java.nio.file.attribute.FileAttribute; import java.nio.file.attribute.PosixFilePermission; import java.nio.file.attribute.PosixFilePermissions; +import java.util.HashMap; import java.util.Map; import java.util.Set; @@ -138,6 +139,9 @@ public class ShellTask extends AbstractTask { taskExecutionContext.getScheduleTime()); // replace variable TIME with $[YYYYmmddd...] in shell file when history run job and batch complement job if (taskExecutionContext.getScheduleTime() != null) { + if (null == paramsMap) { + paramsMap = new HashMap<>(); + } String dateTime = DateUtils.format(DateUtils.add(taskExecutionContext.getScheduleTime(), DAY_OF_MONTH, 1), Constants.PARAMETER_FORMAT_TIME); Property p = new Property(); p.setValue(dateTime);