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 d201a1f261..4781143c9d 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 @@ -270,16 +270,9 @@ public class SqlTask extends AbstractTask { String result = JSONUtils.toJsonString(resultJSONArray); logger.debug("execute sql : {}", result); - // if there is a result set - if (!resultJSONArray.isEmpty(null) ) { - if (StringUtils.isNotEmpty(sqlParameters.getTitle())) { - sendAttachment(sqlParameters.getTitle(), - JSONUtils.toJsonString(resultJSONArray)); - }else{ - sendAttachment(taskExecutionContext.getTaskName() + " query resultsets ", - JSONUtils.toJsonString(resultJSONArray)); - } - } + sendAttachment(StringUtils.isNotEmpty(sqlParameters.getTitle()) ? + sqlParameters.getTitle(): taskExecutionContext.getTaskName() + " query result sets", + JSONUtils.toJsonString(resultJSONArray)); } /**