ruanwenjun commented on a change in pull request #5556:
URL: https://github.com/apache/dolphinscheduler/pull/5556#discussion_r641947608



##########
File path: 
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java
##########
@@ -495,8 +495,18 @@ public void printReplacedSql(String content, String 
formatSql, String rgex, Map<
         //parameter print style
         logger.info("after replace sql , preparing : {}", formatSql);
         StringBuilder logPrint = new StringBuilder("replaced sql , 
parameters:");
-        for (int i = 1; i <= sqlParamsMap.size(); i++) {
-            logPrint.append(sqlParamsMap.get(i).getValue() + "(" + 
sqlParamsMap.get(i).getType() + ")");
+        if(sqlParamsMap == null) { 
+               logger.info("printReplacedSql: sqlParamsMap is null.");
+        }
+        else {                 
+               for (int i = 1; i <= sqlParamsMap.size(); i++) {
+                       if(sqlParamsMap.get(i) == null ) { 
+                               logger.info("printReplacedSql:  
sqlParamsMap.get({}) is null.", i);

Review comment:
       I just want to confirm something, it seems that this method is used to 
print some parameters for debug?
   You may need to modify the print log content here, because I may not know 
what is `sqlParamsMap`, a more friendly log should tell me which parameter is 
null. 
   It seems there is no special meaning to print` i` here, because I can't know 
which parameter is null.  The `i` cannot represent the position of the 
parameter in SQL, am I right?




-- 
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.

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


Reply via email to