You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2023/01/11 09:32:44 UTC
[GitHub] [dolphinscheduler] ChPi commented on a diff in pull request #13352: Fix Bug #13136,list param expand caught NPE, when sql has ?
ChPi commented on code in PR #13352:
URL: https://github.com/apache/dolphinscheduler/pull/13352#discussion_r1066765262
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-sql/src/main/java/org/apache/dolphinscheduler/plugin/task/sql/SqlTask.java:
##########
@@ -506,7 +506,7 @@ private SqlBinds getSqlAndSqlParamsMap(String sql) {
// replace the ${} of the SQL statement with the Placeholder
String formatSql = sql.replaceAll(rgex, "?");
// Convert the list parameter
- formatSql = ParameterUtils.expandListParameter(sqlParamsMap, formatSql);
+ formatSql = ParameterUtils.expandListParameter(sqlParamsMap, sql, rgex);
Review Comment:
i think its better to merge `sql.replaceAll` and `ParameterUtils.expandListParameter`, only one replace like `replaceOriginalValue`
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-sql/src/main/java/org/apache/dolphinscheduler/plugin/task/sql/SqlTask.java:
##########
@@ -506,7 +506,7 @@ private SqlBinds getSqlAndSqlParamsMap(String sql) {
// replace the ${} of the SQL statement with the Placeholder
String formatSql = sql.replaceAll(rgex, "?");
// Convert the list parameter
- formatSql = ParameterUtils.expandListParameter(sqlParamsMap, formatSql);
+ formatSql = ParameterUtils.expandListParameter(sqlParamsMap, sql, rgex);
Review Comment:
i think its better to merge `sql.replaceAll` and `ParameterUtils.expandListParameter`, like `replaceOriginalValue`
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org