From 46f058698170fff573bbd02af74762ded639769c Mon Sep 17 00:00:00 2001 From: lgcareer <18610854716@163.com> Date: Tue, 11 Aug 2020 10:42:59 +0800 Subject: [PATCH] If worker group id is null,don't need to set the value of the worker group (#3460) * [Fix-3423][dao][sql]Fixed that the resource file of the task node can't be found when upgrade from 1.2.0 to 1.3.x * [Fix-3423][dao]If worker group id is null,don't need to set the value of the worker group --- .../dolphinscheduler/dao/upgrade/UpgradeDao.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/upgrade/UpgradeDao.java b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/upgrade/UpgradeDao.java index 59c2cbc874..3d35b68aac 100644 --- a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/upgrade/UpgradeDao.java +++ b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/upgrade/UpgradeDao.java @@ -297,11 +297,14 @@ public abstract class UpgradeDao extends AbstractBaseDao { for (int i = 0 ;i < tasks.size() ; i++){ JSONObject task = tasks.getJSONObject(i); Integer workerGroupId = task.getInteger("workerGroupId"); - if (workerGroupId == null || workerGroupId == -1) { - task.put("workerGroup", "default"); - }else { - task.put("workerGroup", oldWorkerGroupMap.get(workerGroupId)); + if (workerGroupId != null) { + if (workerGroupId == -1) { + task.put("workerGroup", "default"); + } else { + task.put("workerGroup", oldWorkerGroupMap.get(workerGroupId)); + } } + } jsonObject.remove(jsonObject.getString("tasks"));