From cc41485d503ef79f0378df4731e3f7f7c983ce8c Mon Sep 17 00:00:00 2001 From: houshitao <33045461+hstdream@users.noreply.github.com> Date: Sun, 10 Jul 2022 01:31:44 +0800 Subject: [PATCH] [Bug][Api] Complete Data workflow remove duplicates. (#10868) Co-authored-by: houshitao --- .../dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java index d4baa59d9d..2bdd7eb6f4 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java @@ -986,7 +986,8 @@ public class ExecutorServiceImpl extends BaseServiceImpl implements ExecutorServ */ private String removeDuplicates(String scheduleTimeList) { if (StringUtils.isNotEmpty(scheduleTimeList)) { - return Arrays.stream(scheduleTimeList.split(COMMA)).map(String::trim).collect(Collectors.joining(COMMA)); + Set dateSet = Arrays.stream(scheduleTimeList.split(COMMA)).map(String::trim).collect(Collectors.toSet()); + return String.join(COMMA, dateSet); } return null; }