fengjian1129 commented on code in PR #11598:
URL: https://github.com/apache/dolphinscheduler/pull/11598#discussion_r969335822


##########
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:
   The purpose here is to start the thread to print the progress log of MR, so 
that there is a progress log of HIVE SQL execution in the worker log file, and 
then we can obtain appids using the LogUtils.getAppids() method.



-- 
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]

Reply via email to