Browse Source

[Improvement-11291][sql] Improvement the log output while executing multiple sql statements (#11292)

3.2.0-release
rickchengx 2 years ago committed by GitHub
parent
commit
b3bbf69b2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      dolphinscheduler-task-plugin/dolphinscheduler-task-sql/src/main/java/org/apache/dolphinscheduler/plugin/task/sql/SqlTask.java

3
dolphinscheduler-task-plugin/dolphinscheduler-task-sql/src/main/java/org/apache/dolphinscheduler/plugin/task/sql/SqlTask.java

@ -296,7 +296,6 @@ public class SqlTask extends AbstractTask {
private String executeQuery(Connection connection, SqlBinds sqlBinds, String handlerType) throws Exception { private String executeQuery(Connection connection, SqlBinds sqlBinds, String handlerType) throws Exception {
try (PreparedStatement statement = prepareStatementAndBind(connection, sqlBinds)) { try (PreparedStatement statement = prepareStatementAndBind(connection, sqlBinds)) {
logger.info("{} statement execute query, for sql: {}", handlerType, sqlBinds.getSql());
ResultSet resultSet = statement.executeQuery(); ResultSet resultSet = statement.executeQuery();
return resultProcess(resultSet); return resultProcess(resultSet);
} }
@ -368,7 +367,7 @@ public class SqlTask extends AbstractTask {
ParameterUtils.setInParameter(entry.getKey(), stmt, prop.getType(), prop.getValue()); ParameterUtils.setInParameter(entry.getKey(), stmt, prop.getType(), prop.getValue());
} }
} }
logger.info("prepare statement replace sql : {} ", stmt); logger.info("prepare statement replace sql : {}, sql parameters : {}", sqlBinds.getSql(), sqlBinds.getParamsMap());
return stmt; return stmt;
} catch (Exception exception) { } catch (Exception exception) {
throw new TaskException("SQL task prepareStatementAndBind error", exception); throw new TaskException("SQL task prepareStatementAndBind error", exception);

Loading…
Cancel
Save