caishunfeng commented on code in PR #11598:
URL: https://github.com/apache/dolphinscheduler/pull/11598#discussion_r969397805
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-sql/src/main/java/org/apache/dolphinscheduler/plugin/task/sql/SqlTask.java:
##########
@@ -306,13 +319,31 @@ private String executeUpdate(Connection connection,
List<SqlBinds> statementsBin
int result = 0;
for (SqlBinds sqlBind : statementsBinds) {
try (PreparedStatement statement =
prepareStatementAndBind(connection, sqlBind)) {
+
+ sqlLogListener(statement);
+
result = statement.executeUpdate();
logger.info("{} statement execute update result: {}, for sql:
{}", handlerType, result, sqlBind.getSql());
}
}
return String.valueOf(result);
}
+ /**
+ * sql log listener
+ *
+ * @param statement statement
+ * @throws SQLException sqlException
+ */
+ private void sqlLogListener(PreparedStatement statement) throws
SQLException {
+ if (DbType.HIVE == DbType.valueOf(sqlParameters.getType())) {
+ logger.info("The current sql task type is [{}], will start a demon
thread to resolve the appIds", DbType.HIVE);
+
+ HiveSqlLogThread queryThread = new HiveSqlLogThread(statement,
logger,taskExecutionContext);
Review Comment:
Is it possible to parse all the logs at once after execution?
--
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]