From f7e89e4561da0b76bf82a496c2649994664a051c Mon Sep 17 00:00:00 2001 From: songgg <1172417734@qq.com> Date: Mon, 30 Mar 2020 12:09:34 +0800 Subject: [PATCH 1/2] some annotation optimizations (#2333) Co-authored-by: songqh --- .../dolphinscheduler/api/service/ExecutorService.java | 2 +- .../apache/dolphinscheduler/common/enums/ZKNodeType.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ExecutorService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ExecutorService.java index 86b507f0a0..fe43f10b78 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ExecutorService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ExecutorService.java @@ -98,7 +98,7 @@ public class ExecutorService extends BaseService{ String receivers, String receiversCc, RunMode runMode, Priority processInstancePriority, int workerGroupId, Integer timeout) throws ParseException { Map result = new HashMap<>(5); - // timeout is valid + // timeout is invalid if (timeout <= 0 || timeout > MAX_TASK_TIMEOUT) { putMsg(result,Status.TASK_TIMEOUT_PARAMS_ERROR); return result; diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/ZKNodeType.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/ZKNodeType.java index 8982c2a838..b4b3c59321 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/ZKNodeType.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/ZKNodeType.java @@ -22,10 +22,10 @@ package org.apache.dolphinscheduler.common.enums; public enum ZKNodeType { /** - * 0 do not send warning; - * 1 send if process success; - * 2 send if process failed; - * 3 send if process ending; + * 0 master node; + * 1 worker node; + * 2 dead_server node; + * 3 task_queue node; */ MASTER, WORKER, DEAD_SERVER, TASK_QUEUE; } From 4440b35c4e1a56eeadddd4b6881ad70684350726 Mon Sep 17 00:00:00 2001 From: Rubik-W <39549317+Rubik-W@users.noreply.github.com> Date: Mon, 30 Mar 2020 16:22:44 +0800 Subject: [PATCH 2/2] fix #2334 (#2335) Co-authored-by: dailidong --- .../dolphinscheduler/server/worker/task/sql/SqlTask.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java index 12f4b580e9..7da6bd9115 100644 --- a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java +++ b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java @@ -299,7 +299,11 @@ public class SqlTask extends AbstractTask { while (resultSet.next()) { JSONObject mapOfColValues = new JSONObject(true); for (int i = 1; i <= num; i++) { - mapOfColValues.put(md.getColumnName(i), resultSet.getObject(i)); + if (StringUtils.isNotEmpty(md.getColumnLabel(i))) { + mapOfColValues.put(md.getColumnLabel(i), resultSet.getObject(i)); + } else { + mapOfColValues.put(md.getColumnName(i), resultSet.getObject(i)); + } } resultJSONArray.add(mapOfColValues); }