rickchengx commented on code in PR #11292:
URL: https://github.com/apache/dolphinscheduler/pull/11292#discussion_r941063741
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-sql/src/main/java/org/apache/dolphinscheduler/plugin/task/sql/SqlTask.java:
##########
@@ -302,6 +302,7 @@ private String executeQuery(Connection connection, SqlBinds
sqlBinds, String han
private String executeUpdate(Connection connection, List<SqlBinds>
statementsBinds, String handlerType) throws Exception {
int result = 0;
for (SqlBinds sqlBind : statementsBinds) {
+ logger.info("{} statement execute update query, for sql: {}",
handlerType, sqlBind.getSql());
try (PreparedStatement statement =
prepareStatementAndBind(connection, sqlBind)) {
result = statement.executeUpdate();
logger.info("{} statement execute update result: {}, for sql:
{}", handlerType, result, sqlBind.getSql());
Review Comment:
> This place has already been printed, do you want to print both sides?
If the sql statement is correct, it will be printed 2 times: once before
execution and once after execution gets the result
**However**, if an error occurs in the execution of the sql statement, the
log after the execution cannot be printed.
Here is an example: error when executing multiple hive sql statements
<img width="1041" alt="截屏2022-08-09 16 29 59"
src="https://user-images.githubusercontent.com/38122586/183603658-aba81485-269a-49c6-9b7f-b981fcc8f08e.png">
And since `toString()` is not implemented in the class
`HivePreparedStatement`, the user cannot find which sql statement is executing
and throws an exception.
--
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]