From 00cb3f85eccb54f1a2d427c656f88d0fc1b61b1d Mon Sep 17 00:00:00 2001 From: Wenjun Ruan Date: Thu, 24 Nov 2022 21:26:52 +0800 Subject: [PATCH] cherry-pick Fix sql task will send alert if we don't choose the send email #12984 --- .../org/apache/dolphinscheduler/plugin/task/sql/SqlTask.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-sql/src/main/java/org/apache/dolphinscheduler/plugin/task/sql/SqlTask.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-sql/src/main/java/org/apache/dolphinscheduler/plugin/task/sql/SqlTask.java index 178c9c335c..0e56d7d6c9 100644 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-sql/src/main/java/org/apache/dolphinscheduler/plugin/task/sql/SqlTask.java +++ b/dolphinscheduler-task-plugin/dolphinscheduler-task-sql/src/main/java/org/apache/dolphinscheduler/plugin/task/sql/SqlTask.java @@ -274,7 +274,7 @@ public class SqlTask extends AbstractTask { } } String result = JSONUtils.toJsonString(resultJSONArray); - if (sqlParameters.getSendEmail() == null || sqlParameters.getSendEmail()) { + if (Boolean.TRUE.equals(sqlParameters.getSendEmail())) { sendAttachment(sqlParameters.getGroupId(), StringUtils.isNotEmpty(sqlParameters.getTitle()) ? sqlParameters.getTitle() : taskExecutionContext.getTaskName() + " query result sets", result);