diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/ParameterUtils.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/ParameterUtils.java index 4328810fbe..a6dd53ea22 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/ParameterUtils.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/ParameterUtils.java @@ -98,11 +98,11 @@ public class ParameterUtils { }else if (dataType.equals(DataType.DOUBLE)){ stmt.setDouble(index, Double.parseDouble(value)); }else if (dataType.equals(DataType.DATE)){ - stmt.setString(index, value); + stmt.setDate(index, java.sql.Date.valueOf(value)); }else if (dataType.equals(DataType.TIME)){ stmt.setString(index, value); }else if (dataType.equals(DataType.TIMESTAMP)){ - stmt.setString(index, value); + stmt.setTimestamp(index, java.sql.Timestamp.valueOf(value)); }else if (dataType.equals(DataType.BOOLEAN)){ stmt.setBoolean(index,Boolean.parseBoolean(value)); } 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 68a63ea9af..854f78adce 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 @@ -211,7 +211,7 @@ public class SqlTask extends AbstractTask { if (StringUtils.isNotEmpty(sqlParameters.getTitle())){ String title = ParameterUtils.convertParameterPlaceholders(sqlParameters.getTitle(), ParamUtils.convert(paramsMap)); - logger.info("SQL tile : {}",title); + logger.info("SQL title : {}",title); sqlParameters.setTitle(title); }