SbloodyS commented on code in PR #16595:
URL: 
https://github.com/apache/dolphinscheduler/pull/16595#discussion_r1770718258


##########
dolphinscheduler-task-plugin/dolphinscheduler-task-sql/src/main/java/org/apache/dolphinscheduler/plugin/task/sql/SqlTask.java:
##########
@@ -253,9 +255,18 @@ private String resultProcess(ResultSet resultSet) throws 
Exception {
                 : JSONUtils.toJsonString(resultJSONArray);
 
         if (Boolean.TRUE.equals(sqlParameters.getSendEmail())) {
+            resultJSONArray.forEach(row -> {
+                row.fields().forEachRemaining(field -> {
+                    if (field.getValue() instanceof NullNode) {
+                        field.setValue(new TextNode("null"));
+                    }
+                });
+            });
+            String sendResult = resultJSONArray.isEmpty() ? 
JSONUtils.toJsonString(generateEmptyRow(resultSet))
+                    : JSONUtils.toJsonString(resultJSONArray);

Review Comment:
   > I don't know how to write a unit test for this piece.
   
   You can take a look at other UT.
   
   > I started all the projects and tested them with simulated data.
   
   Testing is used to ensure the normal operation in the future, and the 
current normal operation cannot guarantee that the future will not be affected 
by other factors.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to